Support token editing within GraphEditor UI#2943
Conversation
…l of node inputs Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
…ring for interface inputs Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
Signed-off-by: mialana <aliu@amyliu.dev>
There was a problem hiding this comment.
Hi @mialana,
This looks really good! There are some minor comments on variants to check.
I see you find all parent tokens for the active child node.
You could simplify logic by just getting the tokens for the current (selected) node/nodegraph. The user interaction and display would be simplified as well as a user knows exactly what scope the token change is occurring at. I leave it up to you -- either way is fine.
I didn't run this but have you checked that a token change can indeed cause the image's referenced to update, or is this a second step after the core + edit logic here is added ?
Thanks.
Signed-off-by: mialana <aliu@amyliu.dev>
Great! Yes, here is a demo where I edit a token in the table, and the material preview is updated thereafter.
For the design decision you mention, my initial thought process was that displaying parent tokens is useful as then the table exposes all tokens that are available for use in Does that make sense to you as well? Thank you for the code review! |
kwokcb
left a comment
There was a problem hiding this comment.
This looks good to go.
Just leaving a final test check that the editing values works for the cases in
the token_graph and token_graph_material. A snapshot or short gif/video would be good to show the result. There is a nodedef with token instance so that will check the latest logic you added in to cover that case. Thanks!
…class Signed-off-by: mialana <aliu@amyliu.dev>
e8d5b3e to
3644bd6
Compare
Signed-off-by: mialana <aliu@amyliu.dev>
|
MaterialX Token Editing - 'token_graph_material.mtlx' Functionality Demo MaterialX Token Editing - 'token_graph.mtlx' Functionality Demo @kwokcb Sorry for the delay in getting these videos posted. I will say that the videos demonstrate that the editing process is not yet completely bug-free. Namely:
Given these videos, I am curious whether you'd like to fix these bugs before this PR is approved? I believe that the problems demonstrated should have already existed before my changes, and if possible could be addressed separately. I can also provide some more details on anything if needed! Thank you, hope my update make sense and let me know preferred next steps. |
|
|
kwokcb
left a comment
There was a problem hiding this comment.
Thanks for your work on this Amy. This looks good to go!
If you can log the update issue you found at your convenience that would be much
appreciated. Thx.
Signed-off-by: mialana <aliu@amyliu.dev>
…ialX into support-token-editing
|
@mialana Thanks for the |
Hi @jstone-lucasfilm sorry for such the slow turnaround times! I've just resolved the conflict. Please let me know if anything else is needed! |
jstone-lucasfilm
left a comment
There was a problem hiding this comment.
This looks nearly ready to merge, thanks @mialana, and I had just two additional suggestions for improvements.
…ted inputs of token map entries Signed-off-by: mialana <aliu@amyliu.dev>
…ialX into support-token-editing
|
Hi @jstone-lucasfilm your last two suggestions have both been applied. Let me know how it looks now. Thank you so much for taking the time to give me pointers on my code quality! |
jstone-lucasfilm
left a comment
There was a problem hiding this comment.
Just one more suggested fix, and then I think this is good to go!
| } | ||
|
|
||
| // Traverse through inputs and determine which tokens their value depends on | ||
| for (const auto& input : getNode()->getActiveInputs()) |
There was a problem hiding this comment.
Apologies, as I should have caught this in my earlier review, but I believe we need a null check for this call to getNode, as it's very possible that the current element is not a node.
Since you're storing the return value of getNode in the currElem variable above, you might consider storing this value as node and then returning early if its value is null, as there is effectively no further work to do in this case.
For example, this might look like the following:
void UiNode::buildUiTokenMap()
{
_uiTokenMap.clear();
mx::NodePtr node = getNode();
if (!node)
return;
mx::ElementPtr currElem = node;
while (currElem)
{
...
}
for (const auto& input : node->getActiveInputs())
{
...
}
}


Hello! This is a PR for Dev Days 2026. It features:
Tokenstable to improve user experience. Namely:Source Elementcolumn, which contains the graph element where the token is declared / was discovered during upwards traversal.Affected Inputscolumn, which lists which of the node's inputs reference the token.Feel free to point out any inefficiencies or inconsistencies I've made in implementation. Thank you!