godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.46k stars 21.07k forks source link

Cannot replace old Mesh Library file to get a fresh Mesh Library #25896

Closed rainlizard closed 1 year ago

rainlizard commented 5 years ago

Godot version: Godot Engine v3.1.beta4

  1. Load Mesh Library into GridMap
  2. In your GridMap Items change the meshes to white cubes (or anything).
  3. Go to your Mesh Library Source Scene and convert a new Mesh Library again, use the same filename as the old one. (Merge with existing: OFF)
  4. Check your GridMap Items and they will still be white cubes. You can try loading the Mesh Library into the GridMap again but it won't help.

The workaround is to use a different filename when converting the Mesh Library, then load the new filename into your GridMap and it will be a fresh Mesh Library.

KoBeWi commented 4 years ago

Can anyone still reproduce this bug in Godot 3.2.3 rc3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

rainlizard commented 4 years ago

Yeah it's still busted, but after reading my original bug report I think I wasn't very clear.

This is all about the inability to overwrite a file when the "Merge With Existing" option is unchecked.

This issue only occurs when saving over an existing file. (so the workaround is to use a new filename)

Godot version: Godot_v3.2.3-rc3_win64 Minimal Reproduction Project: meshlibrarybug.zip

Steps to reproduce:

  1. Open project
  2. Open scene: Main.tscn
  3. With the GridMap node: load meshlibrary.meshlib, take note of what's in there.
  4. Open scene: MeshlibrarySourceScene.tscn
  5. Delete Cube
  6. Convert to MeshLibrary, Uncheck "Merge With Existing", save as meshlibrary.meshlib, press OK to overwrite.
  7. Open scene: Main.tscn
  8. With the GridMap node: load meshlibrary.meshlib, take note of what's in there.

Bug: the cube is still in there even though I deleted the cube.

KoBeWi commented 4 years ago

Ok this is weird. I tried the steps and the cube got removed. So I tried again to make sure and I could remove the second mesh. I inspected the meshlib file and it wasn't there, so I restarted the editor and the mesh was gone. Before restarting editor I tried removing the meshlib from gridmap and reloading scene and nothing helped, so the resource was probably cached somewhere. When you overwrite the meshlib, it doesn't get reloaded properly, hence this issue.

Coincidentally I ran into a very similar issue today which made me create a proposal: https://github.com/godotengine/godot-proposals/issues/1400 Still, this is bugged. If you overwrite something from editor, it should be properly reloaded.

rainlizard commented 4 years ago

Oops you're completely right, my bad. It is overwriting the file. The .meshlib file is decreasing in filesize from 99KB to 66KB when I remove the cube and save it. You're right it's the editor itself that isn't noticing the newly updated file until you restart Godot.

However the funny thing is, it updates the resource in the Gridmap instantly if you add a new mesh using a "Merge With Existing" (checked). You don't have to restart Godot at all in that particular case.