The "Convert to -> MeshLibrary" button always stretches meshes so that their bounds fit exactly in one block. However, this annoying behavior can be avoided, by not using the button.
MeshLibrary extends Resource, and has all the method you need to create it in GDScript.
To create an empty MeshLibrary, just call MeshLibrary.new(). Once it is filled, use ResourceSaver.save().
Make yourself a list of Meshes, (or just iterate over a Directory containing them), then for each one, call my_mesh_library.create_item(), and set:
- item name
- item mesh
- item shape (use
my_mesh.create_convex_shape()
)
- item preview (use
get_editor_interface().make_mesh_previews()
in a tool script extending EditorScript).
Writing code to create your MeshLibrary is tedious, but allows for more possibilities, and future Mesh additions are more practical.
Edit: Not to be confused between Mesh and MeshInstance. Mesh is a Resource that contains faces, Materials, etc, whereas MeshInstance is a Spatial that displays a Mesh. (get_node("Mesh1").mesh)