How to create MeshLibrary grom CSGMeshes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dmitriy

I create CSGMesh wall and SCGMesh door. I want a hole cut out in the wall for the door. My walls is a GridMap. I can’t create MeshLibrary from CSGMesh. Why?

:bust_in_silhouette: Reply From: smix8

MeshLibrary requires mesh resources for the multimesh instancing.

A CSGMesh is a node for CSG operations, it is not a mesh.

You need to bake the result of the CSG operation(s) into a real mesh resource to use it with MeshLibrary.

Use a script and the get_meshes() function on your CSG root object. The returned data array has the transform at index 1 and the mesh resource at index 2. If you do not need the transform you can save the mesh directly to a new resource in your filesystem. If you need to the transform you need to bake it to the mesh e.g. by using the MeshData tool.