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

    Class SetEnvironmentMaterial

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

    Sets environmental material properties such as textures and appearance attributes for the scene environment.

    Applies materials to environment slots (floor, walls, backdrop textures). Takes slotId and materialId. Use for scene-based configurators where the environment is also customizable — kitchen visualizers, room planners, trade show booth designers.

    Pattern: new SetEnvironmentMaterial('floor-slot-id', 'material-uuid'). Get valid slot and material IDs from the environment definition's slots array in configuratorDataUpdated. Only useful when the active environment has configurable material slots.

    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 material:', data);
    });

    api.sendCommandToMetabox(new SetEnvironmentMaterial(
    'carpaint',
    'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
    ));
    };

    The slot ID.

    The material ID.

    Index

    Constructors

    Properties

    Constructors

    Properties

    data: ToMetaBoxMessageEnvelope

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