From 54e72d4e6ca4aba24ceeb541b24d2a5ec00e0ca8 Mon Sep 17 00:00:00 2001 From: Zeyu Ma Date: Thu, 1 Aug 2024 23:23:30 -0400 Subject: [PATCH] hotfix nested setattr (previously through exec) --- infinigen/core/nodes/node_wrangler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/infinigen/core/nodes/node_wrangler.py b/infinigen/core/nodes/node_wrangler.py index 55eaefd4d..34d08bf32 100644 --- a/infinigen/core/nodes/node_wrangler.py +++ b/infinigen/core/nodes/node_wrangler.py @@ -196,8 +196,12 @@ def new_node( node.name = label if attrs is not None: - for key, val in attrs.items(): - setattr(node, key, val) + for key_path, val in attrs.items(): + keys = key_path.split(".") + obj = node + for key in keys[:-1]: + obj = getattr(obj, key) + setattr(obj, keys[-1], val) if node_type in [ Nodes.VoronoiTexture,