Skip to content

Commit 9ff67c2

Browse files
author
Leandro Inocencio
committed
Incorporated basic evaluation logic to play and test nodes
1 parent 0ae7f2e commit 9ff67c2

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

NodeGraphQt/base/node.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def output_ports(self):
669669
list[NodeGraphQt.Port]: node output ports.
670670
"""
671671
return self._outputs
672-
672+
673673
def input(self, index):
674674
"""
675675
Return the input port with the matching index.
@@ -775,6 +775,36 @@ def on_input_disconnected(self, in_port, out_port):
775775
"""
776776
return
777777

778+
def update_streams(self, *args):
779+
"""
780+
Update all nodes joined by pipes to this.
781+
"""
782+
nodes = []
783+
trash = []
784+
785+
for port, nodeList in node.connected_output_nodes().items():
786+
nodes.extend(nodeList)
787+
788+
while nodes:
789+
node = nodes.pop()
790+
if node not in trash:
791+
trash.append(node)
792+
793+
for port, nodeList in node.connected_output_nodes().items():
794+
nodes.extend(nodeList)
795+
796+
if not nodes:
797+
try:
798+
node.run()
799+
except Exception as error:
800+
print("Error Update Streams: %s" % str(error))
801+
802+
def run(self):
803+
"""
804+
Node evaluation logics.
805+
"""
806+
return
807+
778808

779809
class BackdropNode(NodeObject):
780810
"""

0 commit comments

Comments
 (0)