Preparing search index...

    A native asset that provides a 3D mesh of the user's face. Import with Editor.Model.AssetManager#createNativeAsset. Learn more in the Face Mesh guide.

        // FaceMesh is a native asset that provides a 3D mesh following a detected face.
    // It offers fine-grained control over which geometry regions are enabled.

    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const assetManager = model.project.assetManager;

    const sourcePath = new Editor.Model.SourcePath(
    new Editor.Path(''),
    Editor.Model.SourceRootDirectory.Assets
    );

    const faceMesh = assetManager.createNativeAsset(
    'FaceMesh',
    'MyFaceMesh',
    sourcePath
    ) as Editor.Assets.FaceMesh;

    if (!Editor.isNull(faceMesh)) {
    // Configure geometry regions
    faceMesh.faceGeometryEnabled = true;
    faceMesh.eyeGeometryEnabled = true;
    faceMesh.eyeCornerGeometryEnabled = false;
    faceMesh.mouthGeometryEnabled = true;
    faceMesh.earGeometryEnabled = false;
    faceMesh.skullGeometryEnabled = false;

    // Set the face index and expression multiplier
    faceMesh.faceIndex = 0;
    faceMesh.expressionMultiplier = 1.0;

    console.log(`Created FaceMesh: ${faceMesh.name}`);
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cacheFile: Path

    Path to the cached asset file.

    earGeometryEnabled: boolean

    Enable ear geometry rendering.

    expressionMultiplier: number

    Scale factor applied to facial expressions.

    externalMesh: FileMesh

    Custom mesh to replace the default face mesh.

    externalMeshMapUV: VertexAttribute

    UV vertex attribute mapping for the external mesh.

    externalScale: number

    Scale factor for the external mesh.

    eyeCornerGeometryEnabled: boolean

    Enable eye corner geometry rendering.

    eyeGeometryEnabled: boolean

    Enable eye geometry rendering.

    faceGeometryEnabled: boolean

    Enable face geometry rendering.

    faceIndex: number

    Index of the tracked face this mesh represents.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    mouthGeometryEnabled: boolean

    Enable mouth geometry rendering.

    name: string

    The name of the asset.

    skullGeometryEnabled: boolean

    Enable skull geometry rendering.

    type: string

    The entity's type.

    Methods

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean