Overwritten Meshes in MeshLibrary for Gridmap for seemingly no reason

Godot Version

Godot 4.6.1 stable

Problem

When trying to do a MeshLibrary for a GridMap, even though the meshes are correctly formatted, the GridMap tiles have their mesh overwritten for seemingly no reason at all. Additionally, the actual mesh when I place it and the preview are not the same.

In this image, I placed every mesh in the order of the menu (a, b, c, d, e, f). As you can see, a and b do not correspond to their preview, while c, d, e and f do not correspond at all to the mesh that they should (as explained below).

Everything I did

In Blender

I modelled different tiles, which are their own object, which have their point of origin at the center, which are all named differently (a, b, c, d, e, f) (I did this to make sure this would not be an issue), they all have -col at the end of their name for collision, they are all spaced (although I tried different spacing and I tried putting all of them at the same place and it doesn’t seem to have any impact). Additionally, I also renamed the mesh data block for each mesh in blender to be 100% sure.

I then export the whole file to glb (by selecting the option “export to glTF 2.0”), to the directory of my Godot project.

In Godot

  1. I open the glb as a new inherited scene, which looks like this:

At this stage everything is exactly like in the .blend file, nothing indicates any problem at all.

  1. I export the scene to MeshLibrary, it gives me a .tres file

  2. I put the MeshLibrary .tres file into the MeshLibrary slot of my GridMap node.

What is going wrong?

It seems to me that the conversion to MeshLibrary is at fault, I tinkered for a few days with different ways to do it and it seems nothing works. I don’t understand why some meshes are overwritten, why some are not, why the preview doesn’t work for some. I would greatly appreciate if anyone could tell me what is going on and/or what I did wrong.

Thank you for your time!

I could be wrong but I believe it has something to do with naming of each mesh, naming of meshlibrary itself, and how Gridmap is placing them into its slot. You might have assigned those mesh library.tres into gridmap earlier and it still “remembers” names from the old library.tres (so to speak) and displays some of the old meshes into the slot associates with them.

Try changing the name of mesh library eg. library_1.tres and assign to Gridmap or

Try creating new project, add a new gridmap node and assign new library.tres

If it doesn’t produce the problem then that is what is happening.

So now you have to find the way to purge all your old gridmap mesh assets from your current project somehow to start working on Gridmap from clean slate. You could do that by deleting anything that you did with gridmap (.tres, gridmap node, imported glb) or .godot folder..etc.

I think your “GridMap memory” hypothesis is correct.

Today, after booting my computer, and launching godot, I accidentally restarted my computer (while godot was loading), which led to launch it in recovery mode, then in normal mode.

Even though my files have not changed from yesterday the issue was somehow gone and everything now works normally. Is it possible that recovery mode refreshed the metadata?

It’s a bit annoying to have to do all that just to use GridMap normally. Is it possible to report this as a bug to the contributors or something?

I think it would be interesting to have a better understanding as to what is causing this trouble. I originally searched online (reddit & other godot forum posts) for a solution and I noticed a lot of people have a lot of different bugs with GridMap that almost no one seem to have an explanation for.

You could always report as bug if you want their actual response but search there if there’s already something similar first.

From my personal experience with Gridmap and from what I read on the net is that Gridmap is quite limited. I’ve tried to make it work for my level design but it can be tricky if you want your level to be a bit more organic and in the end it’s not worth it for me. As I see it it’s best not to think of Gridmap as a “level builder” but an optimized, grid-based placement tool for square block objects. If your game’s level mainly consists of blocks then it’d do just fine, but if you want something more, like different angle of slopes, round corners..etc then you’d need to get hands on planning with how each objects will be placed next to each other, and that requires working on your 3d program and Godot side by side.