@3dsource/metabox-front-api
    Preparing search index...

    Class GetCamera

    Represents a command to get the camera configuration from Unreal. This class sends a message to the Metabox API to get the camera from a scene. To listen for changes after sending this command, listen to the 'getCameraResult' event.

    Retrieves camera presets for the configurator; allowing extraction and application of saved camera positions.

    Requests current camera state — returns asynchronously via the getCameraResult event. Returns a CameraCommandPayload with fov, mode, position, rotation, and restrictions. Use to save camera positions, create shareable view links, or build 'save this angle' features.

    ALWAYS subscribe to getCameraResult BEFORE calling GetCamera(). Pattern: api.addEventListener('getCameraResult', handler); then api.sendCommandToMetabox(new GetCamera()). The returned CameraCommandPayload can be fed directly back into SetCamera to restore the view.

    import { Communicator, CameraCommandPayload,GetCamera } from '@3dsource/metabox-front-api';
    window.env3DSource.apiReady = (api: Communicator) => {

    //Subscribe to the event before sending the command to ensure you capture the response
    api.addEventListener('getCameraResult', (data:CameraCommandPayload) => {
    console.log('Camera params after get camera command:', data);
    });

    api.sendCommandToMetabox(new GetCamera());
    };
    Index

    Constructors

    Properties

    Constructors

    Properties

    data: ToMetaBoxMessageEnvelope

    The message envelope populated by subclass constructors and sent via Communicator.sendCommandToMetabox.