Load GLTF from ArrayBuffer or Blob

Hello,

Is it possible to load a gltf/glb from an array buffer/blob. I am trying to keep users from accessing the models locally as best as I can, and from what I have read, there isn’t a great way to encrypt the data, especially once it is served to the browser. However, my main concern is actually making it harder to users to get the model files that would end up coming with the product.

Hopefully this makes some sense. I have been reading the source code trying to see what all is available, and it looks like there might be some options there, however I was hoping that someone might have some guidance/advice.

Thanks,
Devin

1 Like

After much searching, I have found some promising things.
https://playground.babylonjs.com/#7F6S08#2
This shows how to do it from a blob - gotten from Load glb model into scene directly from content string. - Questions & Answers - HTML5 Game Devs Forum

1 Like

yep, that looks like a good start. @bghgary may be able to provide more insight if you run into issues.

I have a backlog item to make this easier here: Add support for loading glb from a base64-encoded string or arraybuffer · Issue #5579 · BabylonJS/Babylon.js · GitHub.