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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.