Преглед изворни кода

fix: link from two identical bones ignored in array

this commit softens a check for duplicate links that causes some
configurations of Schema to fail.
I don't think duplicate links do anything bad in general
and they are 100% valid in case of arrays.

I question the wisdom of silently failing instead of raising an error
when these duplicate links are attempted... but I will leave it how
it is for now.
Joseph Brandenburg пре 5 месеци
родитељ
комит
fa18055265
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      base_definitions.py

+ 4 - 3
base_definitions.py

@@ -1045,9 +1045,10 @@ class NodeSocket:
             from_socket = self.name; to_socket = socket
         from_node.outputs[from_socket].is_linked = True
         to_node.inputs[to_socket].is_linked = True
-        for l in from_node.outputs[from_socket].links:
-            if l.to_node==to_node and l.to_socket==to_socket:
-                return None
+        if sort_id == 0: # otherwise it is an array and dupe links are valid.
+            for l in from_node.outputs[from_socket].links:
+                if l.to_node==to_node and l.to_socket==to_socket:
+                    return None
         new_link = NodeLink(
                 from_node,
                 from_socket,