Skip to content

Commit 5b6fc1c

Browse files
Fix property editor not working in MaterialXGraphEditor (#2787)
Fixes an issue where the property editor in `MaterialXGraphEditor` was not working.
1 parent 8d792db commit 5b6fc1c

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

source/MaterialXGraphEditor/Graph.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3604,6 +3604,14 @@ void Graph::propertyEditor()
36043604
if (!input->getConnected())
36053605
{
36063606
showPropertyEditorValue(_currUiNode, input->getInput(), uiProperties);
3607+
3608+
// Update pin to reference the node's input if one was created
3609+
// during editing, so that subsequent frames read the correct value.
3610+
mx::InputPtr nodeInput = _currUiNode->getNode()->getInput(input->getName());
3611+
if (nodeInput && nodeInput != input->getInput())
3612+
{
3613+
input->setElement(nodeInput);
3614+
}
36073615
}
36083616
else
36093617
{

source/MaterialXGraphEditor/UiNode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class UiPin
7979
std::shared_ptr<UiNode> getUiNode() const { return _pinNode; }
8080
ed::PinKind getKind() const { return _kind; }
8181
mx::PortElementPtr getElement() const { return _element; }
82+
void setElement(mx::PortElementPtr element) { _element = element; }
8283
mx::InputPtr getInput() const;
8384
mx::OutputPtr getOutput() const;
8485

0 commit comments

Comments
 (0)