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 assembly updates in one pass rather than slot by slot.
Practical Application
Takes an array of SetComponentMaterial and SetEnvironmentMaterial instances and sends
them as one batch, preserving order. Use it to apply presets or themed bundles across several
components, 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 — walk configurationTree, take each
active component's product.slots and each slot's enabledMaterials. Pattern:
new SetMaterials([new SetComponentMaterial('component-uuid', 'body', 'uuid'), new SetEnvironmentMaterial('floor', 'uuid')]). Nothing is validated client-side: entries are sent
exactly as given, in order, and every referenced component must already be set in the tree.
Keep using SetComponentMaterial 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:ModularConfiguratorEnvelope) => { 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 assembly updates in one pass rather than slot by slot.
Practical Application
Takes an array of SetComponentMaterial and SetEnvironmentMaterial instances and sends them as one batch, preserving order. Use it to apply presets or themed bundles across several components, 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 — walk
configurationTree, take each active component'sproduct.slotsand each slot'senabledMaterials. Pattern:new SetMaterials([new SetComponentMaterial('component-uuid', 'body', 'uuid'), new SetEnvironmentMaterial('floor', 'uuid')]). Nothing is validated client-side: entries are sent exactly as given, in order, and every referenced component must already be set in the tree. Keep usingSetComponentMaterialon its own for a single swatch click.Example
Param: commands
The material commands to apply, in order.