Explorar el Código

Fix: get_all_dependencies absolutley does not do anything

Joseph Brandenburg hace 6 meses
padre
commit
f6a3584b4f
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      utilities.py

+ 7 - 2
utilities.py

@@ -373,15 +373,20 @@ def link_node_containers(tree_path_names, link, local_nc, from_suffix='', to_suf
     
 def get_all_dependencies(nc):
     from .base_definitions import GraphError
-    """ Given a NC, find all dependencies for the NC as a dict of nc.signature:nc"""
+    """ find all dependencies for a mantis node"""
     nodes = []
     check_nodes = [nc]
+    nodes_checked = set()
     while (len(check_nodes) > 0):
         node = check_nodes.pop()
+        nodes_checked.add (node)
         connected_nodes = node.hierarchy_dependencies.copy()
         for new_node in connected_nodes:
-            if new_node in nodes: raise GraphError() 
+            if new_node in nodes:
+                continue
             nodes.append(new_node)
+            if new_node not in nodes_checked:
+                check_nodes.append(new_node)
     return nodes
                 
 def get_all_nodes_of_type(base_tree, bl_idname):