Search Issue Tracker
By Design
Votes
0
Found in [Package]
Issue ID
1328125
Regression
No
[Shadergraph] Reordering enum entries causes the enum to change in the material inspector
Repro steps:
1. Create a shadergraph
2. Create an enum keyword
3. Drag the keyword onto the graph and plug it into base color
4. Make the keyword node's inputs A: 1, B: 0.5, C: 0
5. Save the graph
6. Make a material from the graph
7. Set the enum to C
8. Go to the graph, reorder so C is where A was and A is where C was, and save
8.5: In versions of the editor where the material inspector has not been fixed to update when the enum updates in Shadergraph, restart unity. Otherwise, continue to part 9
9. Select the material
Expected result: the enum on the material is still C
Actual result: the material displays as if the enum was A, but the enum dropdown says it's C
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Getting a deprecated package for JetBrains Rider pop up when opening or creating a project
- [Android] Volume level of the same audio file is different on Samsung Galaxy Tab A8 between 2023.3.0b3 and 2023.3.0b4
- ‘Expected end of value’ warning occurs when a property declaration includes five or more variable references
- Crash on BurstCompilerService::CompileAsync when entering Play mode in a specific scene
- InvalidOperationException when using Game Camera Preview in Scene window with a custom RenderGraph pass
Resolution Note:
This is just how it works unfortunately.
The material stores the enum values as a floating point number, so it's just stored as 0.0, 1.0, 2.0, with no link to the enumeration values for those.
We could design a versioning system that goes and loads all the Materials that use the ShaderGraph and tries to fix up the relevant properties, but that's a bit of hacky fixup path.. it wouldn't fix any Materials that are pulled in to the project later on for example, it would just try and modify existing Materials to apply the transformation.