Preparing search index...

    Class FaceRenderObjectProvider

    Mesh provider for a Face Mesh. Accessible through the control property on a Face Mesh RenderMesh.

    // @input Asset.RenderMesh faceMesh

    var weights = script.faceMesh.control.onExpressionWeightsUpdate.add(function(expWeights){
    // The passed in expressionWeights is a NamedValues: meaning it contains a names and values array. These two arrays correspond to each other.
    print(expWeights.names[0]); // Prints "EyeBlinkLeft"
    print(expWeights.values[0]); // Prints strength of EyeBlinkLeft expression
    });

    Hierarchy (View Summary)

    Index

    Properties

    earGeometryEnabled: boolean

    When true, ears will be included in the Face Mesh geometry.

    Lens Scripting Version 189

    false
    
    eyeCornerGeometryEnabled: boolean

    When true, a small area in the corners of the eyes will be included in the Face Mesh geometry.

    true
    
    eyeGeometryEnabled: boolean

    When true, eyes will be included in the Face Mesh geometry.

    false
    
    faceGeometryEnabled: boolean

    When true, the general face (not including eyes and mouth) will be included in the Face Mesh geometry.

    true
    
    faceIndex: number

    Index of the face this FaceRenderObjectProvider mirrors.

    0
    
    mouthGeometryEnabled: boolean

    When true, the mouth will be included in the Face Mesh geometry.

    false
    
    onExpressionWeightsUpdate: event1<NamedValues, void>

    An event that will fire each time new expression weights are available.

    Lens Scripting Version 306

    In most cases, providers can be accessed via the control property of an asset.

    For example, we can jump to the last frame of an animated texture:

    // @input Asset.Texture myAnimatedTexture
    const myAnimatedTextureProvider = script.myAnimatedTexture.control;
    const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();
    myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1);

    Or do it in TypeScript:

    @component
    export class ProviderExample extends BaseScriptComponent {
    @input()
    myAnimatedTexture: Texture;

    onAwake() {
    const myAnimatedTextureProvider = this.myAnimatedTexture.control as AnimatedTextureFileProvider;
    const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();
    myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1);
    }
    }
    skullGeometryEnabled: boolean

    When true, the skull will be included in the Face Mesh geometry.

    false
    

    The tracking context this effect is being applied to.

    Lens Scripting Version 309

    null
    

    In most cases, providers can be accessed via the control property of an asset.

    For example, we can jump to the last frame of an animated texture:

    // @input Asset.Texture myAnimatedTexture
    const myAnimatedTextureProvider = script.myAnimatedTexture.control;
    const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();
    myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1);

    Or do it in TypeScript:

    @component
    export class ProviderExample extends BaseScriptComponent {
    @input()
    myAnimatedTexture: Texture;

    onAwake() {
    const myAnimatedTextureProvider = this.myAnimatedTexture.control as AnimatedTextureFileProvider;
    const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();
    myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1);
    }
    }

    Methods

    • Returns the weight of the expression with the passed in name. See Expressions for valid expression names.

      Parameters

      • expressionName: string

      Returns number

      Since Lens Scripting Version 306

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

      Parameters

      • type: string

      Returns boolean