Jelajahi Sumber

Fix: Schema Parser Does Not find Schema Dependencies

Joseph Brandenburg 6 bulan lalu
induk
melakukan
d80e6b34ce
1 mengubah file dengan 4 tambahan dan 9 penghapusan
  1. 4 9
      readtree.py

+ 4 - 9
readtree.py

@@ -256,7 +256,8 @@ def get_schema_length_dependencies(node, all_nodes={}):
             for l in inp.links:
                 if "MANTIS_AUTOGENERATED" in l.from_node.signature: 
                     deps.extend([l.from_node]) # why we need this lol
-                if inp in prepare_links_to: 
+                if inp.name in prepare_links_to:
+                    deps.append(l.from_node)
                     deps.extend(get_all_dependencies(l.from_node))
     def deps_filter(dep): # remove any nodes inside the schema
         if len(dep.signature) > len(node.signature):
@@ -265,15 +266,13 @@ def get_schema_length_dependencies(node, all_nodes={}):
                 if dep_sig_elem != node_sig_elem: break # they don't match, it isn't an inner-node
             else: # remove this, it didn't break, meaning it shares signature with outer node
                 return False # this is an inner-node
-            return True
-        pass
+        return True
     # this way we can handle Schema and Array Get nodes with one function
     extend_dependencies_from_inputs(node)
     if node.node_type == 'DUMMY_SCHEMA':
         trees = [(node.prototype.node_tree, node.signature)] # this is UI data
         while trees:
             tree, tree_signature = trees.pop()
-            print(tree_signature)
             for sub_ui_node in tree.nodes:
                 if sub_ui_node.bl_idname in ['NodeReroute', 'NodeFrame']:
                     continue
@@ -284,11 +283,7 @@ def get_schema_length_dependencies(node, all_nodes={}):
                 if sub_node.node_type == 'DUMMY_SCHEMA':
                     extend_dependencies_from_inputs(sub_node)
                     trees.append((sub_node.prototype.node_tree, sub_node.signature))
-    
-    filtered_deps = filter(deps_filter, deps)
-
-
-    return list(filtered_deps)
+    return list(filter(deps_filter, deps))
 
 
 def parse_tree(base_tree):