Deleting .godot folder makes some meshes disappear from the scene
Godot version
4.1
System information
Godot v4.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated GeForce GTX 1050 Ti () - Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 Threads)
Issue description
Godot version: 4.1
OS version: Windows 10
Issue:
Here's the baseline scene:
After closing Godot I deleted my .godot folder to see if I could add it to the .gitignore file. On restarting the engine I noticed that one of the meshes in the scene had disappeared (see MeshInstance3D2 Mesh field):
.godot folder was automatically created without explicit errors
After that I restarted Godot again and the mesh spontaneously reappeared:
I'm not sure ifthis behaviour is intended, as multiple restarts do not seem to be a good practice (and UX).
Steps to reproduce
- Download the project
- Launch it, open the
levels/TestLevel1.tscnscene to see if MeshInstance3D2 has Mesh assigned to it - If it is not, then close Godot and open it again. MeshInstance3D2 should probably get Mesh assigned.
- Then delete the .godot folder and restart the engine, notice the MeshInstance3D2 behavior.
- Restart Godot again and check the MeshInstance3D2 .
Minimal reproduction project
Could you explain your process for creating that MeshInstance?
Its not surprising that deleting the .godot folder while the editor is running would cause issues. Resources that are imported are stored in the .godot folder, since the engine relies on those imported resources, things break.
What is especially concerning though is that the mesh itself appears to disappear and then it reappears after a reload. That probably shouldn't be happening. But to diagnose this issue further, we need to know how the MeshInstance was created, i.e. was it imported directly, was the mesh copied from another source, etc.
I did not delete the .godot folder with the engine still running. First I closed it, then deleted the folder. My bad, I didn't mention that.
My process for creating MeshInstance is:
- Select root node in the scene
- Press Ctrl+A anf add new MeshInstance
- Place it in 3D space
- Model some meshes in Blender 3.6, import them via .glTF official importer as .glb file
(res://assets/gltf_files/test_scene_1.glb) - In Advanced Import Settings, press Actions... → Set Mesh Save Paths → Save them to the same folder as .glb file
- Actions... → Extract Materials → Save them to assets/materials folder
- Assign desired Mesh (in this case,
test_scene_1_Thing.res) to the MeshInstance3D2 - The same assignment procedure was done for another Mesh, with
ewrewrname (test_scene_1_Cube.res→ewrewr, sorry for that naming), but there was no problem with it
Does it also happen with a .tres mesh? Possibly related https://github.com/godotengine/godot/issues/77978
I wonder if this is a more general issue related to deleting the .godot folder. Another user and I had both noted in a Discord discussion yesterday that the first editor launch after deleting the .godot folder results in many errors and scenes not opening correctly, but, after restarting again, the second launch works as expected. Errors are gone and scenes open normally.
The editor is closed at the times I delete the folder (which I need to do about every month due to spurious dependency errors that I assume is from a corrupted cache). The last time this occurred for me, I was working in 2D/Godot 4.1-stable/Windows 11. I don't know about the other user.
I also suspect that the auto reload functionality is triggering in correctly.
Just experienced this in Godot 4.2.2 after a git reset. Deleting the .godot directory and opening/closing the editor a couple of times seems to have resolved it, but that reaaaally had me worried for a minute :phew: Singletons were broken, scenes were reporting as corrupt, etc.
Do you mean 4.2.1? Or a custom 4.2.2-dev build?
@AThousandShips Sorry, I should have been more verbose. Godot Engine v4.2.2.rc.custom_build.d5064a7d4 (compiled from the 4.2 branch).