Fix node key collisions in ShaderGraph#2768
Fix node key collisions in ShaderGraph#2768jstone-lucasfilm merged 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
This changelist fixes a name collision error in the ShaderGraph node map. Previously, nodes were keyed by their base name (i.e. getName), which is only unique within the scope of the parent graph. In complex documents where multiple nodes shared the same base name, these map keys would collide, leading to shader generation errors and crashes. In order to address this, the map key now uses the full name path of the node (i.e. getNamePath), which is guaranteed to be unique across the entire document. One specific issue addressed by this change is the Graph Editor crash reported in AcademySoftwareFoundation#1932.
|
This looks like an excellent change =) Nice way of solving the issues we've seen with node names not being unique as graphs are flattened. I only have one small note: The path being used is the node's path in the source MaterialX document, and it may be different from the path the So perhaps the wording "path" here may cause some confusion in the future. An alternative to |
|
That's a great point, @niklasharrysson, and I've updated the naming convention from For now, I'm just directly passing |
niklasharrysson
left a comment
There was a problem hiding this comment.
Great! This looks good to me.
6d0e937
into
AcademySoftwareFoundation:main
This changelist fixes a name collision error in the ShaderGraph node map.
Previously, nodes were keyed by their base name (i.e. getName), which is only unique within the scope of the parent graph. In complex documents where multiple nodes shared the same base name, these map keys would collide, leading to shader generation errors and crashes.
In order to address this, the map key now uses the full name path of the node (i.e. getNamePath), which is guaranteed to be unique across the entire document.
One specific issue addressed by this change is the Graph Editor crash reported in #1932.