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.

ImporterMesh

Inherits: Resource < RefCounted < Object

A Resource that contains vertex array-based geometry during the import process.

Description

ImporterMesh is a type of Resource analogous to ArrayMesh. It contains vertex array-based geometry, divided in surfaces. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.

Unlike its runtime counterpart, ImporterMesh contains mesh data before various import steps, such as lod and shadow mesh generation, have taken place. Modify surface data by calling clear, followed by add_surface for each surface.

Properties

Dictionary

_data

{ "surfaces": [] }

Methods

void

add_blend_shape(name: String)

void

add_surface(primitive: PrimitiveType, arrays: Array, blend_shapes: Array[Array] = [], lods: Dictionary = {}, material: Material = null, name: String = "", flags: int = 0)

void

clear()

void

generate_lods(normal_merge_angle: float, normal_split_angle: float, bone_transform_array: Array)

int

get_blend_shape_count() const

BlendShapeMode

get_blend_shape_mode() const

String

get_blend_shape_name(blend_shape_idx: int) const

Vector2i

get_lightmap_size_hint() const

ArrayMesh

get_mesh(base_mesh: ArrayMesh = null)

Array

get_surface_arrays(surface_idx: int) const

Array

get_surface_blend_shape_arrays(surface_idx: int, blend_shape_idx: int) const

int

get_surface_count() const

int

get_surface_format(surface_idx: int) const

int

get_surface_lod_count(surface_idx: int) const

PackedInt32Array

get_surface_lod_indices(surface_idx: int, lod_idx: int) const

float

get_surface_lod_size(surface_idx: int, lod_idx: int) const

Material

get_surface_material(surface_idx: int) const

String

get_surface_name(surface_idx: int) const

PrimitiveType

get_surface_primitive_type(surface_idx: int)

void

set_blend_shape_mode(mode: BlendShapeMode)

void

set_lightmap_size_hint(size: Vector2i)

void

set_surface_material(surface_idx: int, material: Material)

void

set_surface_name(surface_idx: int, name: String)


Property Descriptions