Does gltf loader support loading separate blob stream?

Hi team,

Say I have a group of gltf files exported separately from blender, for example => mesh.gltf, mesh.bin and mesh.png.

when I load from local, it works fine since the gltf loader trace the relative path to find data buffer and textures. While when I download them separately via blob, for example, mesh.gltf => blob:http://10.0.0.117:4000/xxxxxx, mesh.bin => blob:http://10.0.0.117:4000/yyyyyy, mesh.png => blob:http://10.0.0.117:4000/zzzzzz. it cannot trace the path of bin and png when using SceneLoader API. Any idea to load the seprately gltf via blob? thank you in advance for your reply.

Pinging @bghgary

The easiest solution is to use glTFFileLoader.preprocessUrlAsync to map the relative urls referenced in the glTF to the blob urls. Does that work?

1 Like

Thanks for your reply! But… I have no idea about how to deal with SceneLoader.LoadAssetContainerAsync() if I use glTFFileLoader.preprocessUrlAsync for remapping the uri. Any place to find an example?

Ideally I would encourage you to try to use it in the Playground and report it if it does not work so we can easily fix the code for you

Do something like what documented here:
https://doc.babylonjs.com/divingDeeper/importers/loadingFileTypes#advanced-usage

1 Like