Preparing search index...

    Base class for all script-accessible Lens Studio objects.

        // ScriptObject is the base class for all native editor objects.
    // Use getTypeName() to identify type and Editor.isNull() to check validity.
    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;
    const so = scene.addSceneObject(scene.rootSceneObjects[0]);
    so.name = 'ScriptObjectDemo';

    // getTypeName() returns the native type name
    console.log('Type name:', so.getTypeName());

    // isOfType() checks type hierarchy
    console.log('Is SceneObject:', so.isOfType('SceneObject'));

    // Editor.isNull() checks if the native object is still valid
    console.log('Is valid:', !Editor.isNull(so));
    so.destroy();
    console.log('After destroy, isNull:', Editor.isNull(so));

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    key: Key
    modifiers: KeyboardModifier
    text: string

    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

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean