Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

MeshLibrary

Inherits: Resource < RefCounted < Object

Library of meshes.

Description

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.

Tutorials

Methods

void

clear()

void

create_item(id: int)

int

find_item_by_name(name: String) const

PackedInt32Array

get_item_list() const

Mesh

get_item_mesh(id: int) const

Transform3D

get_item_mesh_transform(id: int) const

String

get_item_name(id: int) const

int

get_item_navigation_layers(id: int) const

NavigationMesh

get_item_navigation_mesh(id: int) const

Transform3D

get_item_navigation_mesh_transform(id: int) const

Texture2D

get_item_preview(id: int) const

Array

get_item_shapes(id: int) const

int

get_last_unused_item_id() const

void

remove_item(id: int)

void

set_item_mesh(id: int, mesh: Mesh)

void

set_item_mesh_transform(id: int, mesh_transform: Transform3D)

void

set_item_name(id: int, name: String)

void

set_item_navigation_layers(id: int, navigation_layers: int)

void

set_item_navigation_mesh(id: int, navigation_mesh: NavigationMesh)

void

set_item_navigation_mesh_transform(id: int, navigation_mesh: Transform3D)

void

set_item_preview(id: int, texture: Texture2D)

void

set_item_shapes(id: int, shapes: Array)


Method Descriptions

void clear()

Clears the library.


void create_item(id: int)

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

You can get an unused ID from get_last_unused_item_id.


int find_item_by_name(name: String) const

Returns the first item with the given name.


PackedInt32Array get_item_list() const

Returns the list of item IDs in use.


Mesh get_item_mesh(id: int) const

Returns the item's mesh.


Transform3D get_item_mesh_transform(id: int) const

Returns the transform applied to the item's mesh.