File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,10 @@ def topo_sort(graph):
2323 return topo_order
2424
2525 graph = { node :set () for node in node_tree .nodes }
26+ node_input_link_count = { i :0 for node in node_tree .nodes for i in node .inputs }
2627 for link in node_tree .links :
2728 graph [link .from_node ].add (link .to_node )
29+ node_input_link_count [link .to_socket ] += 1
2830 sorted_nodes = topo_sort (graph )
2931
3032 column_index = {}
@@ -52,7 +54,7 @@ def topo_sort(graph):
5254 output_count = len (list (filter (lambda i : i .enabled , node .outputs )))
5355 parent_props = [prop .identifier for base in type (node ).__bases__ for prop in base .bl_rna .properties ]
5456 properties_count = len ([prop for prop in node .bl_rna .properties if prop .identifier not in parent_props ])
55- unset_vector_count = len (list (filter (lambda i : i .enabled and i .type == 'VECTOR' and len ( i . links ) == 0 , node .inputs )))
57+ unset_vector_count = len (list (filter (lambda i : i .enabled and i .type == 'VECTOR' and node_input_link_count [ i ] == 0 , node .inputs )))
5658 node_height = (
5759 NODE_HEADER_HEIGHT \
5860 + (output_count * NODE_LINK_HEIGHT ) \
You can’t perform that action at this time.
0 commit comments