A script asset that is written in JavaScript.

#script-assetshttps://docs.snap.com/lens-studio/5.0.0/essential-skills/scripting/scripting-introduction
interface JavaScriptAsset {
    componentId: Uuid;
    description: string;
    exportId: Uuid;
    fileMeta: AssetImportMetadata;
    icon: Icon;
    id: Uuid;
    name: string;
    type: string;
    version: Version;
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    isScriptInputHidden(inputName: string): boolean;
    remapReferences(referenceMapping: object): void;
    setScriptInputHidden(inputName: string, hidden: boolean): void;
}

Hierarchy (view full)

Properties

componentId: Uuid

Id associated with the script asset.

description: string

Description associated with the script asset

exportId: Uuid

Export id associated with the script asset.

icon: Icon

Icon associated with the script asset.

id: Uuid

The unique id of the entity.

name: string

The name of the asset.

type: string

The entity's type.

version: Version

Version associated with the script asset.

Methods

  • Beta

    Parameters

    • type: string

    Returns boolean

  • Beta

    Returns true if the script inpput is hidden from the scene.

    Parameters

    • inputName: string

    Returns boolean

  • Beta

    Swap this entity for another one based on a JSON of the current entity id and the target entity id.

    Parameters

    • referenceMapping: object

    Returns void

  • Beta

    Used when you'd like to hide inputs from users in the scene.

    Parameters

    • inputName: string
    • hidden: boolean

    Returns void