Skip to main content

RenderMesh

Class

Represents a mesh asset.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Example

//@input Component.RenderMeshVisual meshComponent
//@input Asset.RenderMesh mesh
script.meshComponent.mesh = script.mesh;

Extends

Properties

aabbMax

readonly aabbMax: vec3

Returns the maximum value in each dimension of the axis-aligned bounding box containing this mesh.


aabbMin

readonly aabbMin: vec3

Returns the minimum value in each dimension of the axis-aligned bounding box containing this mesh.


control

control: RenderObjectProvider

The RenderObjectProvider for this RenderMesh, which can provide more controls depending on the mesh type. See also: FaceRenderObjectProvider


indexType

readonly indexType: MeshIndexType

The index data type used by this mesh.


name

name: string

The name of the Asset in Lens Studio.

Default Value

""

Inherited from

Asset.name


topology

readonly topology: MeshTopology

The topology type used by this mesh.


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Asset.uniqueIdentifier

Methods

extractBoneInverseMatrices()

extractBoneInverseMatrices(): mat4[]

Get the bone inverse matrices on the mesh

Returns

mat4[]

Since

Lens Scripting Version 278


extractBoneNames()

extractBoneNames(): string[]

Get the bone names on the mesh.

Returns

string[]

Since

Lens Scripting Version 278


getIndexBuffer()

getIndexBuffer(): Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>

Returns a variant containing either a vector of 16-bit or 32-bit unsigned integers representing the indices of the mesh, or an empty state if no indices are present.

Returns

Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>


getTypeName()

static getTypeName(): TypeName<RenderMesh>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<RenderMesh>

Overrides

Asset.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Asset.getTypeName


getVertexDataForAttribute()

getVertexDataForAttribute(attributeName): Float32Array

Returns a typed array containing vertex data for the specified attribute. More efficient than extractVerticesForAttribute as it uses Float32Array instead of Number[].

Parameters

ParameterType
attributeNamestring

Returns

Float32Array

Since

Lens Scripting Version 336


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Asset.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Asset.isSame

See also

RenderMeshVisual.