Skip to content

Commit

Permalink
Review updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Sep 23, 2024
1 parent c654659 commit 62145f3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/QuiltiX/qx_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def update_from_mx_node(self, mx_node):
return

self.change_type(mx_def_type)
self.complete_outputs_on_mx_node(mx_node)
self.complete_outputs_for_multioutputs(mx_node)
self.set_properties_from_mx_node(mx_node)

def add_type_property(self, current_type_name=None):
Expand Down Expand Up @@ -424,20 +424,23 @@ def create_property(
# name = self.get_mx_input_name_from_property_name(name)
super().create_property(name, value, items, range, widget_type, tab)

def complete_outputs_on_mx_node(self, mx_node):
def complete_outputs_for_multioutputs(self, mx_node):

# Handle with node outputs are not explicitly specified on
# a multioutput node. Note that this must be done
# before the qx_node is created and before connections are made.
if mx_node.getType() == "multioutput":
mx_node_def = mx_node.getNodeDef()
if mx_node_def:
for mx_output in mx_node_def.getActiveOutputs():
mx_output_name = mx_output.getName()
if not mx_node.getOutput(mx_output_name):
mx_output_type = mx_output.getType()
mx_node.addOutput(mx_output_name, mx_output_type)

if mx_node.getType() != "multioutput":
return

mx_node_def = mx_node.getNodeDef()
if not mx_node_def:
return

for mx_output in mx_node_def.getActiveOutputs():
mx_output_name = mx_output.getName()
if not mx_node.getOutput(mx_output_name):
mx_output_type = mx_output.getType()
mx_node.addOutput(mx_output_name, mx_output_type)

def set_properties_from_mx_node(self, mx_node):

Expand Down

0 comments on commit 62145f3

Please sign in to comment.