:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/MeshLibrary.xml. .. _class_MeshLibrary: MeshLibrary =========== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` Library of meshes. .. rst-class:: classref-introduction-group Description ----------- A library of meshes. Contains a list of :ref:`Mesh` resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in :ref:`GridMap`. .. rst-class:: classref-introduction-group Tutorials --------- - `3D Kinematic Character Demo `__ - `3D Platformer Demo `__ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create_item` **(** :ref:`int` id **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`find_item_by_name` **(** :ref:`String` name **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolIntArray` | :ref:`get_item_list` **(** **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Mesh` | :ref:`get_item_mesh` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`get_item_mesh_transform` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_name` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NavigationMesh` | :ref:`get_item_navmesh` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`get_item_navmesh_transform` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_item_preview` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_item_shapes` **(** :ref:`int` id **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_last_unused_item_id` **(** **)** |const| | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_item` **(** :ref:`int` id **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_mesh` **(** :ref:`int` id, :ref:`Mesh` mesh **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_mesh_transform` **(** :ref:`int` id, :ref:`Transform` mesh_transform **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_name` **(** :ref:`int` id, :ref:`String` name **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_navmesh` **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_navmesh_transform` **(** :ref:`int` id, :ref:`Transform` navmesh **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_preview` **(** :ref:`int` id, :ref:`Texture` texture **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | +---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_MeshLibrary_method_clear: .. rst-class:: classref-method void **clear** **(** **)** Clears the library. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_create_item: .. rst-class:: classref-method void **create_item** **(** :ref:`int` id **)** Creates a new item in the library with the given ID. You can get an unused ID from :ref:`get_last_unused_item_id`. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_find_item_by_name: .. rst-class:: classref-method :ref:`int` **find_item_by_name** **(** :ref:`String` name **)** |const| Returns the first item with the given name. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_list: .. rst-class:: classref-method :ref:`PoolIntArray` **get_item_list** **(** **)** |const| Returns the list of item IDs in use. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_mesh: .. rst-class:: classref-method :ref:`Mesh` **get_item_mesh** **(** :ref:`int` id **)** |const| Returns the item's mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_mesh_transform: .. rst-class:: classref-method :ref:`Transform` **get_item_mesh_transform** **(** :ref:`int` id **)** |const| Returns the transform applied to the item's mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_name: .. rst-class:: classref-method :ref:`String` **get_item_name** **(** :ref:`int` id **)** |const| Returns the item's name. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_navmesh: .. rst-class:: classref-method :ref:`NavigationMesh` **get_item_navmesh** **(** :ref:`int` id **)** |const| Returns the item's navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_navmesh_transform: .. rst-class:: classref-method :ref:`Transform` **get_item_navmesh_transform** **(** :ref:`int` id **)** |const| Returns the transform applied to the item's navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_preview: .. rst-class:: classref-method :ref:`Texture` **get_item_preview** **(** :ref:`int` id **)** |const| When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using :ref:`set_item_preview`. Returns an empty :ref:`Texture` if no preview was manually set in a running project. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_item_shapes: .. rst-class:: classref-method :ref:`Array` **get_item_shapes** **(** :ref:`int` id **)** |const| Returns an item's collision shapes. The array consists of each :ref:`Shape` followed by its :ref:`Transform`. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_get_last_unused_item_id: .. rst-class:: classref-method :ref:`int` **get_last_unused_item_id** **(** **)** |const| Gets an unused ID for a new item. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_remove_item: .. rst-class:: classref-method void **remove_item** **(** :ref:`int` id **)** Removes the item. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_mesh: .. rst-class:: classref-method void **set_item_mesh** **(** :ref:`int` id, :ref:`Mesh` mesh **)** Sets the item's mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_mesh_transform: .. rst-class:: classref-method void **set_item_mesh_transform** **(** :ref:`int` id, :ref:`Transform` mesh_transform **)** Sets the transform to apply to the item's mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_name: .. rst-class:: classref-method void **set_item_name** **(** :ref:`int` id, :ref:`String` name **)** Sets the item's name. This name is shown in the editor. It can also be used to look up the item later using :ref:`find_item_by_name`. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_navmesh: .. rst-class:: classref-method void **set_item_navmesh** **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** Sets the item's navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_navmesh_transform: .. rst-class:: classref-method void **set_item_navmesh_transform** **(** :ref:`int` id, :ref:`Transform` navmesh **)** Sets the transform to apply to the item's navigation mesh. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_preview: .. rst-class:: classref-method void **set_item_preview** **(** :ref:`int` id, :ref:`Texture` texture **)** Sets a texture to use as the item's preview icon in the editor. .. rst-class:: classref-item-separator ---- .. _class_MeshLibrary_method_set_item_shapes: .. rst-class:: classref-method void **set_item_shapes** **(** :ref:`int` id, :ref:`Array` shapes **)** Sets an item's collision shapes. The array should consist of :ref:`Shape` objects, each followed by a :ref:`Transform` that will be applied to it. For shapes that should not have a transform, use :ref:`Transform.IDENTITY`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`