Open Zireael07 opened 4 years ago
Additionally, it could be useful to add an entry to the resource's contextual menu to view owners, as the only way to do this that I know of is to first click on "Show in FileSystem", and then "View Owners" - which is less intuitive, but still works. An icon for unique resources would definitely help to know one doesn't need to check where the resource is being used.
Related issue: https://github.com/godotengine/godot/issues/16680
Blender does it like this:
Clicking the number makes a unique copy.
What if you made something unique, but too far down the road realize it was a mistake, maybe there should be a means of making it "conform" as it were.
This is probably my misunderstanding talking here. But "local_to_scene" and "make_unique" seem very similar to me. Is it possible that these functionalities could be combined into a single tool?
This is probably my misunderstanding talking here. But "local_to_scene" and "make_unique" seem very similar to me. Is it possible that these functionalities could be combined into a single tool?
They are not the same. "Local to scene" refers to how the data is instanced when the object is created at runtime (each scene gets a unique copy). "Make unique" refers to data itself being unique (i.e. instead of referencing an external resource you keep a copy of the data in the scene directly).
Another case of a person gettting confused by things being shared: https://github.com/godotengine/godot/issues/54062#issuecomment-948462426
While I understand it has to be shared by default for performance reasons, this issue really really needs improvement. Otherwise we'll keep having those sorts of issues raised every couple of months, and potentially even more when 4.0 gets more widely used.
As pointed out in https://github.com/godotengine/godot-proposals/issues/5921, the number of users for each resource should be displayed similar to Blender. If a resource has only 1 user, then it is considered unique, even if you've never clicked Make Unique.
I checked if get_reference_count()
could be useful for this functionality, but no:
Determining unique resources might be tricky.
There is the dependency detection in the editor, could that be used?
Not really, it only lists scenes/resources that have a dependency using ext_resource
. It doesn't have information on how many times the given dependency is used and it won't work with built-in resources.
But in order to be shared across scenes, it has to be an ext_resource, no? Even if it's a built-in resource of scene A, scene B will reference it as an external resource?
It doesn't fully solve the problem but at least i think that if you have an open scene, you can see immediately if a resource is shared between parts of your scene, while it's realy tricky if it's another scene.
But in order to be shared across scenes, it has to be an ext_resource, no?
Well, yeah, but resources shared between scenes are not really a problem. More common is that resources are shared within a single scene, e.g. you make a collision shape node, add it a shape and then duplicate the node. The shape is shared. Or you make AnimationPlayer, add animation, but then decide to split the animation in multiple objects and duplicate the AnimationPlayer. The animations are shared. Or you make a Theme (even outside any scene) and make a Button style, but then you want the same style with another color, so you make new Button type and copy the StyleBox. The StyleBoxes are shared. etc. etc.
Perhaps link to: https://github.com/godotengine/godot-proposals/issues/317
Describe the project you are working on: N/A (generic issue)
Describe the problem or limitation you are having in your project: I forget which resources are unique and which are not (easy when the project is big) This is especially important for a) shaders (performance and/or unexpected effects) and b) collision shapes (we had many reports where people duplicated area2d/area3d and wondered why changing one's shape changed the other's, too)
Describe the feature / enhancement and how it helps to overcome the problem or limitation: Tell us which resources are unique (since all resources are shared by default)
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: Add an icon to the inspector for unique resources
If this enhancement will not be used often, can it be worked around with a few lines of script?: Nope.
Is there a reason why this should be core and not an add-on in the asset library?: Can't be done via add-on, as this changes the editor inspector.
Original issue: https://github.com/godotengine/godot/issues/6922 (I reworded it to indicate unique resources instead of shared since all resources are shared by default)