Skip to content

Multipart configurator

Open the example · JavaScript source

Multipart configurator example

This example loads a small base scene and assembles the selected product from independent .webex files. A stable part ID identifies the slot; merging the same ID replaces it atomically.

await viewer.load('./scenes/base.webex');
await viewer.mergePart('ring-band', './scenes/parts/ring-band.webex', {
  format: 'webex'
});
await viewer.mergePart('head', './scenes/parts/head-08.webex', {
  format: 'webex'
});
await viewer.removePart('ring-band');

The returned promises settle only when the engine reports completion, so the example can disable controls while a transaction is running and restore the previous selection on an error. Keep IDs stable, quote no protocol yourself, and let mergePart() infer transport details.