Skip to content

GraphEditor : Fix top level input connection storage and connection logic.#2830

Open
kwokcb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
kwokcb:root_input_fixes
Open

GraphEditor : Fix top level input connection storage and connection logic.#2830
kwokcb wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
kwokcb:root_input_fixes

Conversation

@kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Mar 18, 2026

Fixes

Fixes: #2815

  • Fix setting of interface names on connection
    • Copies logic from commit: PR
    • This is a general logic fix. 09f66bb
  • Fix connection renaming setting on input rename. Was not considering nodegraph to upstream connections

Note: Does not fix all related issues but prevents data loss and crashing.

Example:

It is possible to connect a root input to a downstream nodegraph and rename -- in this case the default loaded Marble graph.

<?xml version="1.0"?>
<materialx version="1.39" colorspace="lin_rec709">
  <nodegraph name="NG_marble1">
    <input name="base_color_1" type="color3" uiname="Color 1" uifolder="Marble Color" interfacename="root_input" />
    <!-- Rest of marble... -->
    <output name="out" type="color3" nodename="color_mix" />
  </nodegraph>
  <standard_surface name="SR_marble1" type="surfaceshader">
    <input name="base_color" type="color3" nodegraph="NG_marble1" output="out" />
  </standard_surface>
  <surfacematerial name="Marble_3D" type="material">
    <input name="surfaceshader" type="surfaceshader" nodename="SR_marble1" />
  </surfacematerial>
  <input name="root_input" type="color3" value="0.000303527, 0, 0" />
</materialx>

  - Copies logic from commit: AcademySoftwareFoundation@09f66bb
- Fix graph connection setting on input rename.
Copy link
Contributor Author

@kwokcb kwokcb left a comment

Choose a reason for hiding this comment

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

@lfl-eholthouser , @jstone-lucasfilm. This patches enough logic for this workflow to prevent data loss (no connections) / corruption (incorrect connections) / crashing.
It does not fix other outstanding rendering issues.

if (!interfaceName.empty())
{
ConstGraphElementPtr graph = getAncestorOfType<GraphElement>();
if (graph && graph == getParent())
Copy link
Contributor Author

@kwokcb kwokcb Mar 18, 2026

Choose a reason for hiding this comment

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

@jstone-lucasfilm . This is the same fix you put in for validation. Would otherwise fail silently leaving Mtlx doc and UiNode graph with different connections.

}
}
// Is a node graph
else if (uiNode->getNodeGraph())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This branch of logic was missing to handle upstream interfaces to nodegraphs.

uiNode->getOutput()->setConnectedNode(_currUiNode->getNode());
// Is an output port
mx::OutputPtr outputPtr = uiNode->getOutput();
if (outputPtr)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Firewall check if no outputs.

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.

GraphEditor : Crashes clearing name on connected input node

1 participant