-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Local to Scene SubResource Ids change after saving #76693
Comments
To clarify this happens every time the scene is saved? Not just the first time? |
Also what "resource Id" are you talking about here, the id tag in the .tscn file? |
Exactly, you can reproduce the id change infinite times with the same scenes.
Speaking about the example above, the id of the BoxMesh changes in the level.tscn where the MeshInstance3D is instantiated. |
Indeed, it only happens when the mesh in question is in the root of the other scene, so must be something related to that |
It is probably because it fetches the local ID from the other scene, and then finds it does not exist in the current scene and therefore has to regenerate it |
It appears to be happening here, but will investigate a bit further: godot/scene/resources/packed_scene.cpp Lines 305 to 339 in 2a0aef5
|
First of all, thank you for looking into the problem. What you are saying is very good to know, but isn't the usecase of the property local_to_scene exactly this scenario? For instance I could have a scene where a Mesh follows a Path, like traintracks for example. If I want to create a level consisting of multiple tracks with different Curve resources, that do have a standard size, I would assign a default curve resource and set it to local to scene. Therefore I can change each track without manipulating every other track. This at least sounds like the right way to aproach this, but I could very well be mistaken and the best practice is to assign the resource after instantiating a scene. |
My bad I was confused in my first comment and that's why I deleted it, this particular behavior should not be breaking and will see if there's some bug here that can be resolved |
No worries, thanks for looking into it. |
in recent custom 4.1 builds it is regening every ext id on every save even if just one simple file
can use a script like this save all files and regen all ext ids in project
in 4.0.2 this script does not regen every ext id in the project each time it is run (just when needed) but in latest 4.1 it does thanks |
Note that while this is also an issue this is a separate problem and should probably be tracked separately as it likely has a separate fix |
The resource of |
Godot version
4.0.2 & 4.0.3 RC1
System information
Windows 10, Vulkan API 1.3.224, NVIDIA RTX A2000 Laptop GPU
Issue description
When saving a scene containing another recently saved instatiated scene with one or more resources being local to scene, Godot changes the affected Resource ID. This only happens if the Node containing the resource being local to scene is the root.
This Occurance is espacially problematic when working in a team with any source control solution.
Steps to reproduce
Minimal reproduction project
IdChange.zip
In this example saving either child scene before the main scene will cause the error, but only the IDs of the Node labeled "ChanginIDs" will change.
The text was updated successfully, but these errors were encountered: