remove old function
@@ -162,42 +162,3 @@ class NodeGraph(QtGui.QWidget):
nodes (list[BlueprintNodeGraph.Node]): list of node objects.
"""
self._viewer.duplicate_nodes(nodes)
-
- def connect_node_to_node(self, from_node, from_port, to_node, to_port):
- """
- Connects a node with a matching node name and port name to another
- node with matching node name and port name.
-
- Args:
- from_node (str): name of the node.
- from_port (str): name of the node port.
- to_node (str): name of the node.
- to_port (str): name of the node port.
- """
- connection = {}
- for node_item in self._viewer.all_nodes():
- if node_item.name == from_node:
- connection[from_node] = Node(node_item)
- elif node_item.name == to_port:
- connection[to_node] = Node(node_item)
- if connection.get(from_node) and connection.get(to_node):
- break
- if not connection.get(from_node):
- raise Exception('no node named {}'.format(from_node))
- if not connection.get(to_node):
- raise Exception('no node named {}'.format(to_node))
- ports = connection[from_node].inputs() + connection[from_node].outputs()
- for port in ports:
- if port.name() == from_port:
- connection[from_port] = port
- break
- ports = connection[to_node].inputs() + connection[to_node].outputs()
- for port in ports:
- if port.name() == to_port:
- connection[to_port] = port
- break
- if not connection.get(from_port):
- raise Exception('no port {}'.format(from_port))
- if not connection.get(to_port):
- raise Exception('no port {}'.format(to_node))
- connection[from_port].connect_to(connection[to_port])
