Gridmaps and MeshLibrary optimization

Godot Version

Godot 4.2.2


Hi everyone, I’m Gatto and I’ll explain my problem…
I will use GridMaps to create my lowpoly levels.
I would like to set up a MeshLibrary with simple shapes and change the material to them separately.

Let me explain better with an example:
in the MeshLibrary I have a cube, a cylinder and a pyramid all white. I would like to place a cube and give it the red material, a cube with blue material and a cube with yellow material acting outside the MeshLibrary, so as to have only one cube in the MeshLibrary.

This is because having around 50 shapes and over 40 materials I would have to insert over 2000 objects into MeshLibrary… I hope there is another way, help thanks XD