Lens Scripting API
    Preparing search index...

    Class ObjectTrackingTextureProvider

    Controls a segmentation texture and its placement using information provided by Object tracking.

    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);
    }
    }

    Hierarchy (View Summary)

    Index

    Properties

    inputTexture: Texture

    Input texture to crop.

    objectIndex: number

    Methods