Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add indicator to resources that are unique #904

Open
Zireael07 opened this issue May 26, 2020 · 14 comments
Open

Add indicator to resources that are unique #904

Zireael07 opened this issue May 26, 2020 · 14 comments

Comments

@Zireael07
Copy link

Zireael07 commented May 26, 2020

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: godotengine/godot#6922 (I reworded it to indicate unique resources instead of shared since all resources are shared by default)

@Cykyrios
Copy link

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.

@Zireael07
Copy link
Author

Related issue: godotengine/godot#16680

@remram44
Copy link

remram44 commented May 27, 2020

Blender does it like this:

screenshot from Blender

Clicking the number makes a unique copy.

@lukostello
Copy link

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.

@lukostello
Copy link

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?

@YuriSizov
Copy link
Contributor

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

@Zireael07
Copy link
Author

Another case of a person gettting confused by things being shared: godotengine/godot#54062 (comment)

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.

@Calinou
Copy link
Member

Calinou commented Dec 10, 2022

As pointed out in #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.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 10, 2022

I checked if get_reference_count() could be useful for this functionality, but no:
godot windows editor dev x86_64_1LG4nqAsmb
Determining unique resources might be tricky.

@QbieShay
Copy link

There is the dependency detection in the editor, could that be used?

@KoBeWi
Copy link
Member

KoBeWi commented Dec 20, 2022

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.

@QbieShay
Copy link

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.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 20, 2022

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.

@desastreger
Copy link

Perhaps link to:
#317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants