-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Moving or renaming scenes in the editor or changing properties in custom resources causes scene corruption #84981
Comments
Can't reproduce, please attach a minimal project from right before the scene gets corrupted. |
I believe this should work. Please let me know. I deleted the .godot folder as instructed as well as the addons folder in order to make sure I meet GitHub's requirements. The 'player.tscn', 'dev_room.tscn' and 'spell_container.tscn' scenes all are corrupted, and opening them causes the error shown to be logged. |
I know that might be happening here. @export var spell_container_template:PackedScene = preload("res://Content/Cards/Spells/spell_container.tscn") Preload is known to corrupt resource cache in various ways. I think EDIT: We should also improve the errors, because it's not possible to determine which scene failed to load without doing C++ debugging. Also since (I assume) the scene corruption originally happened due to a moved class, #85037 will help preventing such issues. |
I ran into a similar issue that might have been caused by this. After moving/renaming some scenes or scripts in 4.2b5 (or6?) one of my scenes got corrupted and would not open in the editor, even after I reverted all the file changes and moves using git (so all files on disk were back to their pre-change state). Restarting the editor didn't fix it, but running the game did, which felt unexpected. For cases like where it seems that the cache is corrupted (and the engine can tell this, since it's showing you an error), couldn't it just try to re-load the scene from disk once and see if that fixes it? In my case I think this is what happened, but I had to run the game to get it to reload the file cache since it wouldn't do it on open or restart of the editor. |
For what it's worth when a scene becomes corrupt and won't open due to this error:
|
I have another example: Here's what the exported variable looks like script looks like
And here's what it looks like in a saved scene using that script
The script defining the custom resource is only defined by path, and if I move/rename the script Godot won't update the path in the scenes that depend on it. The scene parser seems to fail on errors (not complaining) so in the end you get a supposedly corrupted scene which is actually just a scene with a missing path update BTW restarting the editor doesn't fix this. You need to manually edit the affected tscn files and only then restart the editor I think here's the problem:
get_dependencies only handles ext_resources so it will miss any |
Godot version
4.2.beta4
System information
Windows 11, AMD Ryzen 5 3600, RTX 2060
Issue description
The Godot engine will lose references to scenes UID cache, causing scenes to register as corrupted. Animations will still work and overall functionality will be retained, but the user loses the ability to open the corrupted scenes. The console will show the below error code. Because scene functionality will be preserved, I believe this has to do with how Godot handles the UID caching of scenes with custom resources
Steps to reproduce
This can happen when removing/renaming files whether inside or outside the Godot editor (more common outside the editor). It can also happen if you change, rename or delete properties from custom resources.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: