Open jtnicholl opened 1 year ago
I'm having this problem in 4.1.1 and it's causing me to lose work. Once these warnings have appeared, the next time you open your project, references in resources affected will be missing entirely. This has caused models to go missing, which have to be reassigned in the scenes they were used in, and materials go missing from those models.
The thing costing me the most time is that for some reason, even though I have external materials (not from the .glb file), those that are referenced in the .glb as "use external" are affected by this issue as well. They lose their reference to the shader they were using, causing all the parameters for that material to be removed, so I have to reconfigure everything on top of reassigning the reference.
This issue seems to be intermittent or at least somewhat random, I had time where it didn't happen, but now it is happening frequently enough to halt development of 3D assets until this bug is resolved. It happens on some models/materials and not on others, there doesn't seem to be a common factor between instances.
Is there a reason this issue is not assigned to a milestone? I know there are other people affected by this issue, here and on the Godot forums. And it seems to have been around in some form on older versions too.
I'm having this problem in 4.1.1 and it's causing me to lose work. Once these warnings have appeared, the next time you open your project, references in resources affected will be missing entirely. This has caused models to go missing, which have to be reassigned in the scenes they were used in, and materials go missing from those models.
I noticed something similar, but I couldn't figure out how to reproduce it so I didn't open a separate issue.
What was happening in my case was that the meshes were being saved with the same exact UID as the imported scene. So when loading scenes or resources referencing the mesh, it would try to load the scene they came from instead. But you can't assign a PackedScene to a property that expects a Mesh, so it just assigned null without any errors.
To fix it, I removed the line from the .import
file that stored the UID, then deleted the mesh files, then reimported.
This sounds like a bug that could cause some pretty severe (but possibly rare) problems. I also noticed that when I tried to use the dependency menu to point towards the right resource instead, setting it just did nothing, but that would make sense if the UID's were the same.
I did find that deleting the mesh imports and re-importing the .glb
fixed those temporarily. But it seemed to come back quickly. I didn't try deleting the line from the .import
file, is that the one for the .glb
?
Unfortunately, this "fix" won't work for my broken materials, as they are not imported from the .glb
.
I still don't know why those are being broken in the same way, it has to be because of the UID overlap, I'm just not sure what it was overlapping with. I think I remember the shader reference pointing towards the .glb
or a mesh or something else, but the shader is completely separate to the imported .glb
.
Not sure what we are supposed to do with the invalid UID warning, as it seems to be able to fallback to the text path, but not allow us to fix the UID's.
This sounds like a bug that could cause some pretty severe (but possibly rare) problems.
@VentaGhost I can confirm this. Right now I pretty much cannot properly use git with my project because the .res files will have tons of diffs and it is really bad. If I had any back-end knowledge, I'd immediately go fix it myself, but I do not. :c
@betalars So this issue is still happening in the latest version? I had hoped some of the UID changes that came with 4.2 would fix this. Is this with an existing project from before 4.2 or with a new project created with 4.2? Because I wonder if it's just an issue with your project files. Still very unfortunate there isn't a way to fix this, this bug has basically killed that project I was working on because it kept resetting my materials. Might try importing everything to a fresh project at some point but I'd rather not waste time if the bug still exists. By any chance are you working on Linux? Because I'd expect more people to have experienced this bug especially with large projects unless it's platform specific?
@VantaGhost there still seems to be an issue, as demonstrated in this demo project when initialising a new Project in Godot 4.2
In the last commit, something about the res file changes.
Steps to "reproduce":
git clone git@github.com:betalars/godot-uuid-bug.git
git diff
However, I think this is actually a new issue, as the UUID included in the scene seems to be consistent.
How I forced this error to happen on my side:
@AThousandShips can you try to look into this? I think the issue I've opened before may be it's own problem.
I use nixos as an OS
Unable to do so right now, someone else might be able to look into it
Update: it is a known issue
Godot version
v4.0.beta.custom_build [98e0d5995]
System information
Fedora 36
Issue description
If "save to file" is enabled for meshes or animations in an imported scene, the saved resources are given a random UID if the file doesn't already exist. This is annoying if you've
.gitignore
d these files, which makes sense to do since they're auto-generated from glTF files. For example, I did so for the vehicle meshes in the Truck Town demo. If you clone this repo right now, opening any of the vehicle scenes gives multiple invalid UID errors because when the mesh.res
files are generated they don't get the same UIDs.I don't know how UIDs work, but I assume the way to fix this would be to remember what UID the resources are saved to in the glTF's
.import
file? That way it would be generated with the same UID every time.Steps to reproduce
Minimal reproduction project
https://github.com/godotengine/godot-demo-projects/tree/4.0-dev/3d/truck_town