MeshLibrary
Library of meshes.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MeshLibraryConstructor
public MeshLibrary();Methods27
Clearvoid
public void Clear();Clears the library.
CreateItemvoid
public void CreateItem(int id);Creates an empty item with a unique nonnegative ID. Assign mesh and shapes separately. Avoid sparse IDs in current-version files: 0/7 works in memory, but item 7 data is lost when saved/reloaded.
| Name | Type | Default |
|---|---|---|
id | int | — |
idNew item ID. Use contiguous 0,1,…; also respect the GridMap limit of 65535. Renumbering an existing library requires migration of map cell IDs.
FindItemByNameint
public int FindItemByName(string name);Returns the first item with the given name, or -1 if no item is found.
| Name | Type | Default |
|---|---|---|
name | string | — |
intGetItemCategoryStringName
public StringName GetItemCategory(int id);Returns the category for a specific item id. See also MeshLibrary.SetItemCategory.
| Name | Type | Default |
|---|---|---|
id | int | — |
StringNameGetItemCountint
public int GetItemCount();Returns the number of items present in the library.
intGetItemListint[]
public int[] GetItemList();Returns the list of item IDs in use.
int[]GetItemMeshMesh
public Mesh GetItemMesh(int id);Returns the item's mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
MeshGetItemMeshCastShadowRenderingServer.ShadowCastingSetting
public RenderingServer.ShadowCastingSetting GetItemMeshCastShadow(int id);Returns the item's shadow casting mode.
| Name | Type | Default |
|---|---|---|
id | int | — |
RenderingServer.ShadowCastingSettingGetItemMeshTransformTransform3D
public Transform3D GetItemMeshTransform(int id);Returns the transform applied to the item's mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
Transform3DGetItemNamestring
public string GetItemName(int id);Returns the item's name.
| Name | Type | Default |
|---|---|---|
id | int | — |
stringGetItemNavigationLayersuint
public uint GetItemNavigationLayers(int id);Returns the item's navigation layers bitmask.
| Name | Type | Default |
|---|---|---|
id | int | — |
uintGetItemNavigationMeshNavigationMesh
public NavigationMesh GetItemNavigationMesh(int id);Returns the item's navigation mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
NavigationMeshGetItemNavigationMeshTransformTransform3D
public Transform3D GetItemNavigationMeshTransform(int id);Returns the transform applied to the item's navigation mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
Transform3DGetItemPreviewTexture2D
public Texture2D GetItemPreview(int id);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 MeshLibrary.SetItemPreview. Returns an empty Texture2D if no preview was manually set in a running project.
| Name | Type | Default |
|---|---|---|
id | int | — |
Texture2DGetItemShapesReckfell.Collections.Array
public Reckfell.Collections.Array GetItemShapes(int id);Returns an item's collision shapes.
The array consists of each Shape3D followed by its Transform3D.
| Name | Type | Default |
|---|---|---|
id | int | — |
Reckfell.Collections.ArrayGetLastUnusedItemIdint
public int GetLastUnusedItemId();Gets an unused ID for a new item.
intRemoveItemvoid
public void RemoveItem(int id);Removes the item.
| Name | Type | Default |
|---|---|---|
id | int | — |
SetItemCategoryvoid
public void SetItemCategory(int id, StringName category);Sets the category for a specific item id for organization in the GridMap editor. A category can include / as a delimiter to create subcategories.
| Name | Type | Default |
|---|---|---|
id | int | — |
category | StringName | — |
SetItemMeshvoid
public void SetItemMesh(int id, Mesh mesh);Sets the item's mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
mesh | Mesh | — |
SetItemMeshCastShadowvoid
public void SetItemMeshCastShadow(int id, RenderingServer.ShadowCastingSetting shadowCastingSetting);Sets the item's shadow casting mode to shadow_casting_setting.
| Name | Type | Default |
|---|---|---|
id | int | — |
shadowCastingSetting | RenderingServer.ShadowCastingSetting | — |
SetItemMeshTransformvoid
public void SetItemMeshTransform(int id, Transform3D meshTransform);Sets the transform to apply to the item's mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
meshTransform | Transform3D | — |
SetItemNamevoid
public void SetItemName(int id, 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 MeshLibrary.FindItemByName.
| Name | Type | Default |
|---|---|---|
id | int | — |
name | string | — |
SetItemNavigationLayersvoid
public void SetItemNavigationLayers(int id, uint navigationLayers);Sets the item's navigation layers bitmask.
| Name | Type | Default |
|---|---|---|
id | int | — |
navigationLayers | uint | — |
SetItemNavigationMeshvoid
public void SetItemNavigationMesh(int id, NavigationMesh navigationMesh);Sets the item's navigation mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
navigationMesh | NavigationMesh | — |
SetItemNavigationMeshTransformvoid
public void SetItemNavigationMeshTransform(int id, Transform3D navigationMesh);Sets the transform to apply to the item's navigation mesh.
| Name | Type | Default |
|---|---|---|
id | int | — |
navigationMesh | Transform3D | — |
SetItemPreviewvoid
public void SetItemPreview(int id, Texture2D texture);Sets a texture to use as the item's preview icon in the editor.
| Name | Type | Default |
|---|---|---|
id | int | — |
texture | Texture2D | — |
SetItemShapesvoid
public void SetItemShapes(int id, Reckfell.Collections.Array shapes);Assigns item physics shapes independently from its mesh. Supply an even number of values as Shape3D, Transform3D pairs. Mesh transforms do not substitute for shape transforms.
| Name | Type | Default |
|---|---|---|
id | int | — |
shapes | Reckfell.Collections.Array | — |
idExisting library item ID.
shapesArray of [shape, local transform, …] pairs. A block raised by 1.5 needs that offset assigned separately to its shape and mesh.