Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions source/MaterialXCore/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ void Input::setConnectedInterfaceName(const string& interfaceName)
if (!interfaceName.empty())
{
ConstGraphElementPtr graph = getAncestorOfType<GraphElement>();
if (graph && graph == getParent())
Copy link
Copy Markdown
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.

{
// This element is a direct child of a graph element, so its
// interface name references a value element in the parent scope.
ConstElementPtr graphParent = graph->getParent();
graph = graphParent ? graphParent->getAncestorOfType<GraphElement>() : nullptr;
}
if (graph && graph->getInput(interfaceName))
{
setInterfaceName(interfaceName);
Expand Down
37 changes: 28 additions & 9 deletions source/MaterialXGraphEditor/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3324,35 +3324,54 @@ void Graph::propertyEditor()
}
else if (_currUiNode->getInput())
{
mx::InputPtr currUINodeInput = _currUiNode->getInput();

if (temp != original)
{
std::string name = _currUiNode->getInput()->getParent()->createValidChildName(temp);
std::vector<UiNodePtr> downstreamNodes = _currUiNode->getOutputConnections();
for (UiNodePtr uiNode : downstreamNodes)
std::string name = currUINodeInput->getParent()->createValidChildName(temp);

for (UiNodePtr uiNode : _currUiNode->getOutputConnections())
{
// Is not an input port
if (uiNode->getInput() == nullptr)
{
// Is a node
if (uiNode->getNode())
{
for (mx::InputPtr input : uiNode->getNode()->getActiveInputs())
{
if (input->getInterfaceInput() == _currUiNode->getInput())
if (input->getInterfaceInput() == currUINodeInput)
{
_currUiNode->getInput()->setName(name);
mx::ValuePtr val = _currUiNode->getInput()->getValue();
currUINodeInput->setName(name);
input->setConnectedInterfaceName(name);
}
}
}
// Is a node graph
else if (uiNode->getNodeGraph())
Copy link
Copy Markdown
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.

{
for (mx::InputPtr input : uiNode->getNodeGraph()->getActiveInputs())
{
if (input->getInterfaceName() == currUINodeInput->getName())
{
currUINodeInput->setName(name);
input->setConnectedInterfaceName(name);
mx::InputPtr pt = input->getInterfaceInput();
}
}
}
else
{
uiNode->getOutput()->setConnectedNode(_currUiNode->getNode());
// Is an output port
mx::OutputPtr outputPtr = uiNode->getOutput();
if (outputPtr)
Copy link
Copy Markdown
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.

{
outputPtr->setConnectedNode(_currUiNode->getNode());
}
}
}
}

_currUiNode->getInput()->setName(name);
currUINodeInput->setName(name);
_currUiNode->setName(name);
}
}
Expand Down