Skip to content

Commit 6952ec5

Browse files
alphaditocarson-katri
authored andcommitted
replace dictionary used to count node input links with collections.Counter
1 parent e380e6f commit 6952ec5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/arrange.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import bpy
22
import typing
3-
from collections import deque
3+
from collections import deque, Counter
44

55
def _arrange(node_tree, padding: typing.Tuple[float, float] = (50, 25)):
66
# Organize the nodes into columns based on their links.
@@ -23,7 +23,7 @@ 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 }
26+
node_input_link_count = Counter()
2727
for link in node_tree.links:
2828
graph[link.from_node].add(link.to_node)
2929
node_input_link_count[link.to_socket] += 1

0 commit comments

Comments
 (0)