Skip to content

Unify element storage in Graph Editor classes#2756

Merged
jstone-lucasfilm merged 3 commits intoAcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_graph_editor
Jan 29, 2026
Merged

Unify element storage in Graph Editor classes#2756
jstone-lucasfilm merged 3 commits intoAcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_graph_editor

Conversation

@jstone-lucasfilm
Copy link
Member

This changelist unifies element storage and replaces direct data references with accessor methods in the UiNode, UiPin, and UiEdge classes, providing better encapsulation, and addressing edge cases where data copies within these classes could fall out of sync.

Fixes #1261 and related issues after user edits.

This changelist unifies element storage and replaces direct data references with accessor methods in the `UiNode`, `UiPin`, and `UiEdge` classes, providing better encapsulation, and addressing edge cases where data copies within these classes could fall out of sync.

Fixes AcademySoftwareFoundation#1261 and related issues after user edits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the new getNode() function for the pins be called something like getUiNode() instead of just getNode() since that already exists? I think having pin->getNode()->getNode() is a bit hard to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, and I missed that! I've now renamed UiPin::getNode to UiPin::getUiNode for clarity.

// Remove interface value in order to set the default of the input
pin->_input->setConnectedInterfaceName(mx::EMPTY_STRING);
setDefaults(pin->_input);
setDefaults(_graphNodes[upNode]->getInput());
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why the node input no longer needs to set to the default as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good question. That was an opportunistic fix that I found during testing of the graph editor, where we were unintentionally clearing the defaults of upstream inputs. I believe this new version of the logic is slightly better, and in my local testing I get more consistent behavior when disconnecting and reconnecting pins.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah copy that! These changes look great. Thanks @jstone-lucasfilm

@jstone-lucasfilm jstone-lucasfilm merged commit 2e64ebb into AcademySoftwareFoundation:main Jan 29, 2026
33 checks passed
@jstone-lucasfilm jstone-lucasfilm deleted the dev_graph_editor branch January 29, 2026 00:48
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: Renaming inputs / outputs does not work

2 participants

Comments