Godot version:
3.0.2
OS/device including version:
Win10
Issue description:
When clicking "Make Unique" for a ParticlesMaterial, the setting does not last after saving and closing the scene. Upon reopening/running it will not be unique. Workaround is to duplicate the material in code
Steps to reproduce:
Try to make a Particles2D's material unique in the editor. Save + close the scene, reopen. Will not be unique.
Minimal reproduction project:
Comment out this line in Node2D.gd to test: $Particles2D.process_material = $Particles2D.process_material.duplicate(). I left it in to show that the scripting workaround actually works.
How did you check that it was not made unique?
In the example project: make the material unique. The script runs and sets only 1 of the Particle2Ds to a different shape size. Both change size.
Also when you make it unique the material changes name (in the right panel). After you close+reopen the name reverts to its previous value, indicating that this value was not saved.
I have noticed this with SpatialMaterial too, duplicate a mesh with a material, try to make unique and modify some parameters and you'll see it may not be unique.
Yes I believe it has happened to me on some other materials, maybe Shape2D and something else? ParticlesMaterial is the one I noticed and could easily duplicate though. Pretty serious bug in my opinion
Don't you mean to set it "Local to scene" rather than unique?
Local to scene would auto-duplicate it when loading the scene, while make unique would ensure it is not shared with other scenes (nothing said about other instances of the scene).
Make unique used to create a new resource (duplicated) in the same scene on duplicated nodes, now that option fails with some resources.
I've noticed this happens with materials and shaders, which can be difficult when trying to set_shader_params. You have to duplicate the materials/shaders in code before setting params.
For a quick workaround, one may use duplicate on _ready() function
func _ready():
$Particles2D.process_material = $Particles2D.process_material.duplicate()
According to my tests, this is fixed on master branch.
Please comment here if anyone can reproduce.
Most helpful comment
Make unique used to create a new resource (duplicated) in the same scene on duplicated nodes, now that option fails with some resources.