Skip to content

Commit d0e1ae1

Browse files
committed
exclude backdropNode when process node insert
1 parent 5a004a7 commit d0e1ae1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

NodeGraphQt/base/graph.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from NodeGraphQt.base.factory import NodeFactory
1313
from NodeGraphQt.base.menu import NodeGraphMenu, NodesMenu
1414
from NodeGraphQt.base.model import NodeGraphModel
15-
from NodeGraphQt.base.node import NodeObject
15+
from NodeGraphQt.base.node import NodeObject, BaseNode
1616
from NodeGraphQt.base.port import Port
1717
from NodeGraphQt.constants import (DRAG_DROP_ID,
1818
PIPE_LAYOUT_CURVED,
@@ -132,6 +132,10 @@ def _insert_node(self, pipe, node_id, prev_node_pos):
132132
"""
133133
node = self.get_node_by_id(node_id)
134134

135+
# exclude the BackdropNode
136+
if not isinstance(node,BaseNode):
137+
return
138+
135139
disconnected = [(pipe.input_port, pipe.output_port)]
136140
connected = []
137141

@@ -140,7 +144,9 @@ def _insert_node(self, pipe, node_id, prev_node_pos):
140144
(pipe.output_port, list(node.inputs().values())[0].view)
141145
)
142146
if node.outputs():
143-
connected.append((node.output(0).view, pipe.input_port))
147+
connected.append(
148+
(list(node.outputs().values())[0].view, pipe.input_port)
149+
)
144150

145151
self._undo_stack.beginMacro('inserted node')
146152
self._on_connection_changed(disconnected, connected)

0 commit comments

Comments
 (0)