Skip to content

Commit

Permalink
Merge pull request #85 from kwokcb/add_missing_outputs
Browse files Browse the repository at this point in the history
Add checking for implicit outputs on multioutput nodes on load
  • Loading branch information
manuelkoester authored Sep 24, 2024
2 parents d296314 + 62145f3 commit f5e4010
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/QuiltiX/qx_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def update_from_mx_node(self, mx_node):
return

self.change_type(mx_def_type)
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 @@ -423,7 +424,26 @@ 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_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":
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):

for mx_input in mx_node.getActiveInputs():
mx_input_value = mx_input.getValue()
mx_input_name = mx_input.getName()
Expand Down

0 comments on commit f5e4010

Please sign in to comment.