Skip to content

Commit 1890272

Browse files
_deserialize(): only connect to unoccupied input
1 parent 793fef9 commit 1890272

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

NodeGraphQt/base/graph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,10 @@ def get_node_by_id(nid):
14151415
out_port = out_node.outputs().get(pname) if out_node else None
14161416

14171417
if in_port and out_port:
1418-
self._undo_stack.push(PortConnectedCmd(in_port, out_port))
1418+
# only connect if input port is not connected yet or input port can have multiple connections.
1419+
# important when duplicating nodes.
1420+
if not in_port.model.connected_ports or in_port.model.multi_connection:
1421+
self._undo_stack.push(PortConnectedCmd(in_port, out_port))
14191422

14201423
node_objs = list(nodes.values())
14211424
if relative_pos:

0 commit comments

Comments
 (0)