-
Notifications
You must be signed in to change notification settings - Fork 188
Exporting one bin file per mesh #293
Comments
I’m thinking it would be most promising to have a standalone script that takes a glTF file as input and just splits the payload into multiple bin files. Probably something very similar to one of these projects: The advantage there is that it could be applied to glTF files from any exporter. Also note that making efficient use of this structure would require changes in threejs (in progress: mrdoob/three.js#14779) |
I was thinking about how to split into multiple bin files as you suggest but but I'm not sure where to start. I suppose we need to take the bin file from the original glTF convert to readable on js side, convert it again on multiple bin files and change the "buffers" node on the gltf to add the new ones, and the index/bufferLength/bufferOffset on "bufferViews". Is that premise ok? Meanwhile I try to find on the way to make this .bin > readable content > multiple .bin well split with JavaScript. |
I think that's right. You may also need to split some bufferViews and update accessors referencing them, if meshes you want to split are sharing a bufferView. |
Here is a (very experimental) first attempt: https://github.com/donmccurdy/glTF-Split It currently requires each mesh to (already) be in a separate bufferView, which THREE.GLTFExporter does but other exporters may not. Probably that's not hard to fix but I didn't have the time. |
Newer version, still quite experimental: https://github.com/donmccurdy/glTF-Transform IMO this does probably seem more appropriate for tools outside the exporter itself. |
I saw that is possible to have multiple buffers (bin files) loaded with one gltf file, and I'm looking to have one bin file per mesh when I export a scene.
Is that possible now or is something that is on the roadmap to implement it?
Or you know someone/some branch that is trying to?
Why I'm trying to do this > I have an armature with different parts of the body / clothing items and my goal is to make possible to exchange this meshes (skinned meshes) that use a common armature (and animations).
In case there is another smarter solution, suggestions are welcome.
The text was updated successfully, but these errors were encountered: