Refreshing Cache...

Inherits: Resource < Reference < Object

Library of meshes.


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.

Method Descriptions

  • void clear ( )

Clears the library.

  • void create_item ( int id )

Creates a new item in the library with the given ID.

You can get an unused ID from get_last_unused_item_id.

Returns the first item with the given name.

Returns the list of item IDs in use.

  • Mesh get_item_mesh ( int id ) const

Returns the item’s mesh.

Returns the item’s name.

Returns the item’s navigation mesh.

Returns the transform applied to the item’s navigation mesh.

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.

Returns an item’s collision shapes.

The array consists of each Shape followed by its Transform.

  • int get_last_unused_item_id ( ) const

Gets an unused ID for a new item.

  • void remove_item ( int id )

Removes the item.

  • void set_item_mesh ( int id, Mesh mesh )

Sets the item’s mesh.

Sets the item’s name.

This name is shown in the editor. It can also be used to look up the item later using find_item_by_name.

Sets the item’s navigation mesh.

  • void set_item_navmesh_transform ( int id, Transform navmesh )

Sets the transform to apply to the item’s navigation mesh.

Sets a texture to use as the item’s preview icon in the editor.

  • void set_item_shapes ( int id, Array shapes )

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 Transform.IDENTITY.

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:34:17. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.