replace dictionary used to count node input links with collections.Counter

main
Alfredo 2023-11-16 16:25:59 -05:00 zatwierdzone przez Carson Katri
rodzic e380e6f9db
commit 6952ec507a
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
import bpy
import typing
from collections import deque
from collections import deque, Counter
def _arrange(node_tree, padding: typing.Tuple[float, float] = (50, 25)):
# Organize the nodes into columns based on their links.
@ -23,7 +23,7 @@ def _arrange(node_tree, padding: typing.Tuple[float, float] = (50, 25)):
return topo_order
graph = { node:set() for node in node_tree.nodes }
node_input_link_count = { i:0 for node in node_tree.nodes for i in node.inputs }
node_input_link_count = Counter()
for link in node_tree.links:
graph[link.from_node].add(link.to_node)
node_input_link_count[link.to_socket] += 1