Preparing search index...

    Class ScriptScene

    Represents the Lens scene. Accessible through global.scene.

    if(global.scene.getCameraType() == "front")
    {
    print("the front camera is active");
    }
    else if(global.scene.getCameraType() == "back")
    {
    print("the back camera is active");
    }
    var newObject = global.scene.createSceneObject("newObject");
    

    Hierarchy (View Summary)

    Index

    Properties - Fundamental

    captureTarget: Texture

    The output Render Target of the actual recorded video.

    null
    
    hiddenInCapture: LayerSet

    Layers excluded from capture output (visible on display only). Only available on Wearable (Spectacles).

    LayerSet.none()
    @wearableOnly
    hiddenInDisplay: LayerSet

    Layers excluded from the display (visible in capture output only). Only available on Wearable (Spectacles).

    LayerSet.none()
    @wearableOnly
    isRayTracingSupported: boolean

    Returns true if the device supports Ray Tracing and Advanced Graphics Features is enabled in the project settings.

    liveOverlayTarget: Texture

    Similar to liveTarget, but this RenderTarget will not have predictive motion adjustments applied to it (only applicable on supported devices). Learn more

    null
    
    liveTarget: Texture

    The output Render Target that users will see in the live camera and during recording.

    null
    

    Methods - Fundamental

    • Create a texture containing the DepthStencilRenderTargetProvider.

      Returns Texture

      Lens Scripting Version 152

    • Returns a string describing the currently active device camera.

      Returns "back" if the rear-facing (aka World) camera is active.

      Returns "front" if the front-facing (aka Selfie) camera is active.

      Otherwise, the camera is not initialized.

      Returns string

    • Returns the current recording state of the Lens (e.g. preview, photo, or video).

      Returns RecordingState

      Lens Scripting Version 354

    • Returns the number of SceneObject in the current scene.

      Returns number

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

    • Returns true if the Lens is currently in full-screen mode.

      This is useful for detecting the current viewport state, particularly for Venue AR and gaming use cases where UI layout and interaction models change based on the viewport state.

      Returns boolean

      Lens Scripting Version 375

      // Checking state for late-initialized components or prefabs
      script.createEvent("OnStartEvent").bind(function() {
      if (global.scene.isFullScreen()) {
      setupFullScreenUI();
      }
      });
    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns whether or not the scene is currently being recorded.

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean