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
- OnPostprocessAllAssets() is not called for a modified Prefab when another Asset is set Dirty in the same callback
- [Android] UIToolkit ClickEvent is fired when the device is rotated
- Compilation errors occur when "uintBitsToFloat(int)" gets used in OpenGLES
- User Reporting does not send reports when Managed Stripping Level is set to Low or higher
- Editor crashes and a window with "GetManagerFromContext: pointer to object of manager 'MonoManager' is NULL (table index 5)" error is thrown when launching a project with a corrupted library
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.