MeshInstance

Node that instances meshes into a scenario.

MeshInstance is a node that takes a Mesh resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single Mesh in many places. This allows to reuse geometry and save on resources. When a Mesh has to be instanced more than thousands of times at close proximity, consider using a MultiMesh in a MultiMeshInstance instead.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_meshChanged
void _meshChanged()
_updateSkinning
void _updateSkinning()
createConvexCollision
void createConvexCollision()

This helper creates a StaticBody child node with a ConvexPolygonShape collision shape calculated from the mesh geometry. It's mainly used for testing.

createDebugTangents
void createDebugTangents()

This helper creates a MeshInstance child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing.

createTrimeshCollision
void createTrimeshCollision()

This helper creates a StaticBody child node with a ConcavePolygonShape collision shape calculated from the mesh geometry. It's mainly used for testing.

getActiveMaterial
Ref!Material getActiveMaterial(long surface)

Returns the Material that will be used by the Mesh when drawing. This can return the GeometryInstance.materialOverride, the surface override Material defined in this MeshInstance, or the surface Material defined in the Mesh. For example, if GeometryInstance.materialOverride is used, all surfaces will return the override material.

getMesh
Ref!Mesh getMesh()
getSkeletonPath
NodePath getSkeletonPath()
getSkin
Ref!Skin getSkin()
getSurfaceMaterial
Ref!Material getSurfaceMaterial(long surface)

Returns the Material for a surface of the Mesh resource.

getSurfaceMaterialCount
long getSurfaceMaterialCount()

Returns the number of surface materials.

isSoftwareSkinningTransformNormalsEnabled
bool isSoftwareSkinningTransformNormalsEnabled()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(MeshInstance other)
opEquals
bool opEquals(typeof(null) n)
setMesh
void setMesh(Mesh mesh)
setSkeletonPath
void setSkeletonPath(NodePathArg0 skeleton_path)
setSkin
void setSkin(Skin skin)
setSoftwareSkinningTransformNormals
void setSoftwareSkinningTransformNormals(bool enabled)
setSurfaceMaterial
void setSurfaceMaterial(long surface, Material material)

Sets the Material for a surface of the Mesh resource.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

mesh
Mesh mesh [@property getter]
Mesh mesh [@property setter]

The Mesh resource for the instance.

skeleton
NodePath skeleton [@property getter]
NodePath skeleton [@property setter]

NodePath to the Skeleton associated with the instance.

skin
Skin skin [@property getter]
Skin skin [@property setter]

Sets the skin to be used by this instance.

softwareSkinningTransformNormals
bool softwareSkinningTransformNormals [@property getter]
bool softwareSkinningTransformNormals [@property setter]

If true, normals are transformed when software skinning is used. Set to false when normals are not needed for better performance. See ProjectSettings.rendering/quality/skinning/softwareSkinningFallback for details about how software skinning is enabled.

Static functions

_new
MeshInstance _new()

Construct a new instance of MeshInstance. Note: use memnew!MeshInstance instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta