Represents a command to apply several materials at once.
To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Applies a whole material set in a single message instead of one command per slot. Simulates picking
every swatch of a preset at once, so the scene updates in one pass rather than slot by slot.
Practical Application
Takes an array of SetProductMaterial and SetEnvironmentMaterial instances and sends
them as one batch, preserving order. Use it to apply presets or themed bundles, to restore a saved
configuration, or to sync a full material set from an external PIM/ERP system — instead of firing
(and debouncing) N separate commands.
AI Coding Best Practices
Build the entries from the configuratorDataUpdated envelope — product.slots and environment.slots,
each slot's enabledMaterials. Pattern: new SetMaterials([new SetProductMaterial('body', 'uuid'), new SetEnvironmentMaterial('floor', 'uuid')]). Nothing is validated client-side: entries are sent
exactly as given, in order, and the referenced product must already be set. Keep using
SetProductMaterial on its own for a single swatch click.
//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 materials:', data); });
Represents a command to apply several materials at once. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Applies a whole material set in a single message instead of one command per slot. Simulates picking every swatch of a preset at once, so the scene updates in one pass rather than slot by slot.
Practical Application
Takes an array of SetProductMaterial and SetEnvironmentMaterial instances and sends them as one batch, preserving order. Use it to apply presets or themed bundles, to restore a saved configuration, or to sync a full material set from an external PIM/ERP system — instead of firing (and debouncing) N separate commands.
AI Coding Best Practices
Build the entries from the configuratorDataUpdated envelope —
product.slotsandenvironment.slots, each slot'senabledMaterials. Pattern:new SetMaterials([new SetProductMaterial('body', 'uuid'), new SetEnvironmentMaterial('floor', 'uuid')]). Nothing is validated client-side: entries are sent exactly as given, in order, and the referenced product must already be set. Keep usingSetProductMaterialon its own for a single swatch click.Example
Param: commands
The material commands to apply, in order.