fix port delete
@@ -884,6 +884,7 @@ class BaseNode(NodeObject):
self._inputs.remove(port)
self._model.inputs.pop(port.name())
self._view.delete_input(port.view)
+ port.model.node = None
self.draw()
def delete_output(self, port):
@@ -900,6 +901,7 @@ class BaseNode(NodeObject):
self._outputs.remove(port)
self._model.outputs.pop(port.name())
self._view.delete_output(port.view)
+ port.model.node = None
self.draw()
def set_ports(self, port_data):
@@ -910,8 +912,12 @@ class BaseNode(NodeObject):
port_data(dict): {'input_ports':[{'name':...,'multi_connection':...,'display_name':...,'data_type':...}, ...],
" 'output_ports':[{'name':...,'multi_connection':...,'display_name':...,'data_type':...}, ...]}
"""
- [self._view.delete_input(port.view) for port in self._inputs]
- [self._view.delete_output(port.view) for port in self._outputs]
+ for port in self._inputs:
+ self._view.delete_input(port.view)
+ port.model.node = None
+ for port in self._outputs:
+ self._view.delete_output(port.view)
+ port.model.node = None
self._inputs = []
self._outputs = []
self._model.outputs = {}
