KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.49k stars 317 forks source link

GLB export with image URI support #2169

Open ConorDamery opened 7 months ago

ConorDamery commented 7 months ago

I've recently began using Godot and working off of Kenny's 3D platformer kit, I noticed he had GLB files that contained only mesh binary data and no textures, when inspecting the JSON part of the file I saw that the exporter used "UnityGLTF" has support for binary mesh data and image URI that lends itself very well for in engine use, since I can store shared textures in a separate folder and reuse them avoiding the redundant data of embedded textures.

The exporter support in Blender only has two modes, the fully binary GLB and the file separated GLTF. Ideally there would be a way to configure the GLB export such that it only stores the mesh data and can use texture paths like the GLTF "Keep original" setting.

For now the best solution is to use the separated files, however, because this also adds a .bin file keeping track of it can be problematic when moving files around.

Fighter19 commented 1 week ago

I agree, I just wanted to open the same issue. I'm planning to use glTF Binary as an internal storage format for an application. Seeing, that textures will be shared on a large scale between models, the current export settings from Blender don't make sense to me.

I'd have to hash the texture data each time I'm loading a model to detect a collision, over just sharing the same file.

Fighter19 commented 1 week ago

And for other people looking for a workaround:

Currently, I found that exporting using glTF Seperated, then using "assimp export" works to generate GLBs with separated textures.