Struct MeshLibrary

Library of meshes.

struct MeshLibrary ;

A library of meshes. Contains a list of Mesh resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in GridMap.

Methods

NameDescription
clear Clears the library.
createItem Creates a new item in the library with the given ID. You can get an unused ID from getLastUnusedItemId.
findItemByName Returns the first item with the given name.
getItemList Returns the list of item IDs in use.
getItemMesh Returns the item's mesh.
getItemName Returns the item's name.
getItemNavmesh Returns the item's navigation mesh.
getItemNavmeshTransform Returns the transform applied to the item's navigation mesh.
getItemPreview Returns a generated item preview (a 3D rendering in isometric perspective). Note: Since item previews are only generated in an editor context, this function will return an empty Texture in a running project.
getItemShapes Returns an item's collision shapes. The array consists of each Shape followed by its Transform.
getLastUnusedItemId Gets an unused ID for a new item.
removeItem Removes the item.
setItemMesh Sets the item's mesh.
setItemName Sets the item's name. This name is shown in the editor. It can also be used to look up the item later using findItemByName.
setItemNavmesh Sets the item's navigation mesh.
setItemNavmeshTransform Sets the transform to apply to the item's navigation mesh.
setItemPreview Sets a texture to use as the item's preview icon in the editor.
setItemShapes Sets an item's collision shapes. The array should consist of Shape objects, each followed by a Transform that will be applied to it. For shapes that should not have a transform, use constant Transform.IDENTITY.