Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multioutput connection edits #1506

Conversation

kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Aug 31, 2023

Issue

Fixes #1469

Incorrect connections were being stored on the MaterialX document when making / breaking connections with upstream nodes which have more than one output (mulitoutput nodes).

Fixes

  • Make sure to remove any reference on an input to an upstream output attribute when breaking links.
  • Make sure to add the connection to an upstream output if the upstream node is multioutput. Otherwise use the current logic to connect to the node.
  • If we always add an output reference on the downstream input, then there is a validation warning if the upstream node is not multioutput but you specify an output on the downstream input. This might be worthwhile to remove as it's not really an error.

Tests

Tested with issue graph:

<?xml version="1.0"?>
<materialx version="1.38">
  <separate3 name="separate3_vector3" type="multioutput" xpos="5.050725" ypos="-2.000000">
    <input name="in" type="vector3" nodename="constant_vector3" />
  </separate3>
  <constant name="constant_vector3" type="vector3" xpos="3.405797" ypos="-1.965517" />
  <combine3 name="combine3_vector3" type="vector3" xpos="7.094203" ypos="-2.034483">
    <input name="in1" type="float" nodename="separate3_vector3" output="outy" />
    <input name="in2" type="float" nodename="separate3_vector3" output="outx"/>
    <input name="in3" type="float" nodename="separate3_vector3" output="outz"/>
  </combine3>
</materialx>
  • Test making and breaking connections on the combine node. (Should set / break at the output level).
  • Test making and breaking connection on the constant. (Should be the same as before)

Copy link
Contributor

@lfl-eholthouser lfl-eholthouser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it all looks great to me. Thanks for tackling this issue Bernard!

@jstone-lucasfilm jstone-lucasfilm changed the title Add connection support for multi-output upstream nodes Add support for multioutput connection edits Aug 31, 2023
Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks @kwokcb!

@jstone-lucasfilm jstone-lucasfilm merged commit 4c0f613 into AcademySoftwareFoundation:main Aug 31, 2023
@kwokcb kwokcb deleted the multioutput_connection_fixes branch September 6, 2023 11:46
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…on#1506)

Incorrect connections were being stored on the MaterialX document when making / breaking connections with upstream nodes which have more than one output (mulitoutput nodes).

## Fixes

- Make sure to remove any reference on an input to an upstream output attribute when breaking links.
- Make sure to add the connection to an upstream output if the upstream node is multioutput. Otherwise use the current logic to connect to the node. 
- If we always add an output reference on the downstream input, then there is a validation warning if the upstream node is not multioutput but you specify an output on the downstream input. This might be worthwhile to remove as it's not really an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Graph Editor: connecting separate outputs to combine inputs
3 participants