donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.38k stars 149 forks source link

Merged scenes not visible in viewers #1178

Closed dasmehdix closed 10 months ago

dasmehdix commented 10 months ago

Hi all. I was trying to use gltf-transform@CLI(v3.9.0). Yesterday, I was clearly use "gltf-transform merge" operation succesfully but today when I tried to call it like gltf-transform merge example_input_1.glb example_input_2.glb output.glb it outputs a file without problem. when I check output model on Blender it looks really normal but when I check output on render tools like modelviewer I just see the model that first given. Why this happens? Yes, it merge but why it is not rendered?

example.zip

donmccurdy commented 10 months ago

@dasmehdix the merge command takes all input glTF files, and creates an output glTF file containing one scene per original file. When given a model with multiple scenes, must "viewers" display only the first, but the data is still there for software like Blender or other applications to use.

The CLI doesn't have this option right now, but would be possible to merge all input scenes to a single scene, so that the viewers would show all available content, if that's what you need.

To see the contents of the file, run gltf-transform inspect model.glb, and it will list all scenes.

donmccurdy commented 10 months ago

Adding a --merge-scenes flag to the CLI merge command in https://github.com/donmccurdy/glTF-Transform/pull/1189.