exclude backdropNode when process node insert
@@ -12,7 +12,7 @@ from NodeGraphQt.base.commands import (NodeAddedCmd,
from NodeGraphQt.base.factory import NodeFactory
from NodeGraphQt.base.menu import NodeGraphMenu, NodesMenu
from NodeGraphQt.base.model import NodeGraphModel
-from NodeGraphQt.base.node import NodeObject
+from NodeGraphQt.base.node import NodeObject, BaseNode
from NodeGraphQt.base.port import Port
from NodeGraphQt.constants import (DRAG_DROP_ID,
PIPE_LAYOUT_CURVED,
@@ -132,6 +132,10 @@ class NodeGraph(QtCore.QObject):
"""
node = self.get_node_by_id(node_id)
+ # exclude the BackdropNode
+ if not isinstance(node,BaseNode):
+ return
+
disconnected = [(pipe.input_port, pipe.output_port)]
connected = []
@@ -140,7 +144,9 @@ class NodeGraph(QtCore.QObject):
(pipe.output_port, list(node.inputs().values())[0].view)
)
if node.outputs():
- connected.append((node.output(0).view, pipe.input_port))
+ connected.append(
+ (list(node.outputs().values())[0].view, pipe.input_port)
+ )
self._undo_stack.beginMacro('inserted node')
self._on_connection_changed(disconnected, connected)
