Search Issue Tracker

By Design



Found in [Package]

Issue ID




[Shadergraph] Reordering enum entries causes the enum to change in the material inspector

Package: Shader Graph


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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.