-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
ResourceSaver.save
deletes UID from resource when not running inside the Editor
#83259
Comments
Works correctly when run inside the editor. |
ResourceSaver.save
deletes UID from resourceResourceSaver.save
deletes UID from resource on non-@tool
scripts
ResourceSaver.save
deletes UID from resource on non-@tool
scriptsResourceSaver.save
deletes UID from resource when not running inside the Editor
The uid is set by |
I'm not sure how this should be solved, or even treated, UID is an editor specific feature when assigning, and needs to be in editor to be handled correctly I think this isn't so much a bug as it is a limitation, the one bug would be IMO that you can edit files in the project from a running project, and that this limitation should be documented or you shouldn't be allowed to modify the files this way |
IMHO I do agree that we should not edit files (or edit resources) from a running project, tool script is built for that purpose. But the uid loss is a limition as it might make the user confuse. Although I think it still works well because the path is not lost so user can still reference the resource, just the uid is missing. Also it seems hard to detect this problem as load and save are common operations. |
Yeah, could be done when editing in the |
Godot version
master
branch at ee118e7System information
Arch Linux
Issue description
ResourceSaver.save
removes the UID when present in a resource.I was expecting it to either keep the current UID or generate a new one.
Steps to reproduce
resource_with_uid.tres
has an UID:ResourceSaver.save(load("res://resource_with_uid.tres"))
Minimal reproduction project
ResourceSaverUIDNukeBug.zip
The text was updated successfully, but these errors were encountered: