-
Notifications
You must be signed in to change notification settings - Fork 433
Fix enumeration interfacename bug #2423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ld-kerley
merged 2 commits into
AcademySoftwareFoundation:main
from
ld-kerley:fix-enumeration-interfacename-bug
Jun 3, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
resources/Materials/TestSuite/stdlib/definition/definition_with_enum_interface.mtlx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0"?> | ||
| <materialx version="1.39"> | ||
|
|
||
| <!-- create a custom node that exposes an enumeration input via "interfacename" --> | ||
| <nodedef name="ND_positionwrapper" node="positionwrapper"> | ||
| <input name="wrap_space" type="string" value="object" enum="model, object, world" uniform="true"/> | ||
| <output name="out" type="vector3"/> | ||
| </nodedef> | ||
| <nodegraph name="NG_positionwrapper" nodedef="ND_positionwrapper"> | ||
| <position name="myPos" type="vector3"> | ||
| <input name="space" type="string" interfacename="wrap_space"/> | ||
| </position> | ||
| <output name="out" type="vector3" nodename="myPos"/> | ||
| </nodegraph> | ||
|
|
||
| <positionwrapper name="myPosWrapper" type="vector3"> | ||
| <input name="wrap_space" type="string" value="object"/> | ||
| </positionwrapper> | ||
|
|
||
| <extract name="extract" type="float"> | ||
| <input name="in" type="vector3" nodename="myPosWrapper"/> | ||
| <input name="index" type="integer" value="1"/> | ||
| </extract> | ||
| <surface_unlit name="Srf" type="surfaceshader"> | ||
| <input name="emission" type="float" nodename="extract" /> | ||
| </surface_unlit> | ||
| <surfacematerial name="Mtl" type="material"> | ||
| <input name="surfaceshader" type="surfaceshader" nodename="Srf" /> | ||
| </surfacematerial> | ||
| </materialx> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "bug" appears to be in GLSL and MSL
remapEnumerationmethod. It is returning true when there is no value mapped. MDL returns the correct value offalsein this case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chatted offline with Bernard - we still think the original fix is valid - but I'm gonna put up a PR to fix the return value from
remapEnumerationas well.