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

Data gets overriden on editor reload - closing and reopening #73916

Open
pietru2004 opened this issue Feb 25, 2023 · 16 comments
Open

Data gets overriden on editor reload - closing and reopening #73916

pietru2004 opened this issue Feb 25, 2023 · 16 comments

Comments

@pietru2004
Copy link

Godot version

4.0 beta rc5,rc4,rc3 ...

System information

Windows 10 Forward+

Issue description

When I close editor and open it again resources get overridden.
One material get changed to 1 other material that is constantly selected.
so it is like 1 material is constantly changed to 1 other material (I created 1 material and then another 3 and first got set into fourth created on meshes not affecting the second and third where it was setted)
(Using XR tools) when setting Viewport2Din3D scene it also gets overridden

example.
I set this
obraz
to scene called storage_ui_content.tscn
but it gets back to being settings scene after editor reopening

Also I searched is this bug described in other issue but I could not find it.

Steps to reproduce

Create multiple materials (I not sure how many 10, 15 mayby more)
Create double the amount of meshes - could be cubes
Set materials created before to cubes
Reopen editor
You should see some meshes having changed/not saved material you selected

Minimal reproduction project

N/A

@YuriSizov
Copy link
Contributor

Please provide an MRP. Asking contributors to create dozens of everything in hopes to reproduce the bug is not going to be productive.

@pietru2004
Copy link
Author

ok gona try - it is preety much random, but I gona try

@pietru2004
Copy link
Author

pietru2004 commented Feb 25, 2023

File: godot_bug_mrp.zip
(Nodes are labeled what materials should be where)
Here is How scene should look
obraz

Here is how it looks on my side when I reload/reopen editor
obraz

@Rindbee
Copy link
Contributor

Rindbee commented Feb 25, 2023

Probably due to the same uid.
1

@akien-mga
Copy link
Member

What method did you use to make both sets of materials? Did you use "Duplicate"?

@akien-mga akien-mga added this to the 4.0 milestone Feb 25, 2023
@pietru2004
Copy link
Author

I was duplicating this using rightclick, sometimes using the file system

@pietru2004
Copy link
Author

by file system I mean cp paste to another folder

@KoBeWi
Copy link
Member

KoBeWi commented Feb 25, 2023

If you copied the files outside Godot then having duplicate UIDs is expected, because Godot can't detect and validate that.
Only copy files using the FileSystem dock to avoid problems.
Or if you copy an imported file, don't copy its .import so it's re-generated with unique id.

@pietru2004
Copy link
Author

pietru2004 commented Feb 25, 2023

still expected asset path was diffrent
there is expected uid and path
If those don't match mayby editor should revalidate paths to check do files exist and check for duplicate uids and if that occurs regenerate uids that conflict

@KoBeWi
Copy link
Member

KoBeWi commented Feb 25, 2023

The external dependencies are loaded by UID first and path is only used if the resource is not found under the cached path associated with the UID.

Finding duplicate UIDs is tricky. When you copy a file with UID, Godot will think that the file's path changed rather than it's a duplicate. The only way to detect duplicates is creating a map of all UIDs during a full scan, which is a very costly operation and there isn't really a good time to execute it (aside from manually).

@pietru2004
Copy link
Author

mayby there should be system that says when loading project or importing new that found duplicate uids and what person does want do do with it - replace or make new

@pietru2004
Copy link
Author

or button called regenerate uuid

@pietru2004
Copy link
Author

What about counting all possible/importable assets and then checking number of existing uids
if number is higher then editor loaded/defined uids then it would look for duplicates mayby give some error and regenerate uids for duplicates.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Feb 25, 2023
@pietru2004
Copy link
Author

I want to add to this that FileSystem dock does not support copy,cut and paste and that is why when somebody might need to copy multiple files they might use System File browser for that.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 25, 2023

It does support all these operations via drag and drop or the "Move to..." menu option.
Protip: If you hold Ctrl while the file is being dropped, it will get copied instead of moving.

@pietru2004
Copy link
Author

hm.. All I am gona say that that is not intuitive. When looking at "Move to..." menu option I see more like cut operation or drag and drop rather then copy, in rc5 it copied file that I moved keeping it references and creating unreferenced cp in folder from where I was copying.

Also I mistakenly typed there cut operation cause I just forgot it is just drag and drop operation.

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

5 participants