GLTFExporter: How to export a gltf/glb with multiple root level scenes

Is it currently possible to export multiple scenes using GLTFExporter.parse without wrapping all of the scenes inside of another one? I would like to export these scenes so that when the model is imported with GLTFLoader, they are accessible through the scenes attribute, instead of having all scenes wrapped into a single scene under the scene attribute. I figure I might have to dig around with parse and make some customizations, since it appears that the above behavior was intended to cover this edge case.

This isn’t currently supported by GLTFExporter. If you’ve exported them to multiple GLBs you could merge them offline to create one file with multiple scenes:

gltf-transform merge a.glb b.glb c.glb output.glb

@donmccurdy Is there a client side merge utility?

Yes, the document.merge(other) method. If you’re writing the result into a GLB you’d also want to remove all but one buffer in the final document:

const buffer = document.getRoot().listBuffers()[0];
document.getRoot()
	.listAccessors()
	.forEach((a) => a.setBuffer(buffer));
document.getRoot()
	.listBuffers()
	.forEach((b, index) => (index > 0 ? b.dispose() : null));