Przeglądaj źródła

hack to force initialize nodes for UI changes

this commit is a hack but it is both necessary and harmless
for some reason, probably import or append or file load (don't care), some ui nodes
are not set to initialized and ignore UI changes by the user
this is bad, so I'm forcing them on in a context where I am sure they are ready to go
that being deep in the tree update code, where every node is read into Mantis
if the tree is updating or executing, then of course it is all ready to go!
Joseph Brandenburg 6 miesięcy temu
rodzic
commit
10f251b90f
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      readtree.py

+ 3 - 0
readtree.py

@@ -127,6 +127,9 @@ def make_connections_to_ng_dummy(base_tree, tree_path_names, local_nc, all_nc, n
 def gen_node_containers(base_tree, current_tree, tree_path_names, all_nc, local_nc, dummy_nodes, group_nodes, schema_nodes ):
     from .internal_containers import DummyNode
     for ui_node in current_tree.nodes:
+        # HACK I found that this isn't being set sometimes. I wonder why? It makes the most sense to do this here.
+        if hasattr(ui_node, 'initialized'): ui_node.initialized=True
+        # end HACK. TODO: find out why this is not set sometimes. This is only needed for UI socket change updates.
         if ui_node.bl_idname in ["NodeFrame", "NodeReroute"]:
             continue # not a Mantis Node
         if ui_node.bl_idname in ["NodeGroupInput", "NodeGroupOutput"]: