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

Fix orphaned links when deleting node in graph editor #1667

Merged
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
11 changes: 9 additions & 2 deletions source/MaterialXGraphEditor/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2854,10 +2854,10 @@ void Graph::deleteNode(UiNodePtr node)
}
}

if (node->outputPins.size() > 0)
for (UiPinPtr outputPin : node->outputPins)
{
// Update downNode info
for (UiPinPtr pin : node->outputPins.front()->getConnections())
for (UiPinPtr pin : outputPin.get()->getConnections())
{
mx::ValuePtr val;
if (pin->_pinNode->getNode())
Expand All @@ -2872,6 +2872,13 @@ void Graph::deleteNode(UiNodePtr node)
{
pin->_input->setConnectedNode(nullptr);
}
if (node->getInput())
{
// Remove interface value in order to set the default of the input
pin->_input->removeAttribute(mx::ValueElement::INTERFACE_NAME_ATTRIBUTE);
setDefaults(pin->_input);
setDefaults(node->getInput());
}
}
else if (pin->_pinNode->getNodeGraph())
{
Expand Down