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

    Class SetEnvironment

    Represents a command to set the environment by its ID. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.

    Sets environmental/lighting settings for the scene. Controls factors like lighting conditions and environmental appearance.

    Changes the 3D scene/environment (studio, showroom, outdoor, etc.). Takes an environmentId UUID. Environments include lighting, backdrop, and optionally dynamic sky (udsEnabled) with time-of-day (udsHour) control.

    Call api.sendCommandToMetabox(new SetEnvironment('env-uuid')). Get valid environment IDs from the configurator definition in configuratorDataUpdated. Set environment after product during initialization. Each environment has its own material slots, thumbnails, and lighting properties.

    import { Communicator,ConfiguratorEnvelope } 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('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
    console.log('State updated after applied new environment:', data);
    });

    api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'))
    };

    The environment ID.

    Index

    Constructors

    Properties

    Constructors

    • Parameters

      • environmentId: string

      Returns SetEnvironment

    Properties

    data: ToMetaBoxMessageEnvelope

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