Skip to content

Commit 6ee8ffa

Browse files
authored
Add missing initialization on document load in Graph Editor (#2795)
## Fixes Fixes: #2794. There are references to the previous MaterialX documents on file load ### Change - Clear `_currUiNode` : Would hold onto to last selection if any. This seems the root cause of the property editor crash. - Clear `_currRenderNode` : Should also be cleared to prevent trying to render last node. This seems to also fix having extra renders when load and select nodegraph.
1 parent ae3fb9c commit 6ee8ffa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

source/MaterialXGraphEditor/Graph.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,8 @@ void Graph::initializeGraph()
28532853
_state.graphElem = _graphDoc;
28542854
_state.isCompoundNodeGraph = false;
28552855
_prevUiNode = nullptr;
2856+
_currUiNode = nullptr;
2857+
_currRenderNode = nullptr;
28562858

28572859
// Set the display name from the current material filename.
28582860
mx::FilePath materialPath(_materialFilename);

0 commit comments

Comments
 (0)