Loading base64 data

Apologies, I misinterpreted your question. The other thing I noted is that the link did not go straight to this post from the old forum.


This is a case that the code doesn’t handle. I’ve filed an issue: Add support for loading glb from a base64-encoded string or arraybuffer · Issue #5579 · BabylonJS/Babylon.js · GitHub

In the meantime, you can do this a bit indirectly by using a blob with an object url.

https://playground.babylonjs.com/#7F6S08#2

Note that your base64 encoded string was incorrect compared to the file you attached. I had to re-encoded the data.


As I stated I know very little about glb files and base64 strings. For example I have no idea if a glb file supports all you needs nor whether you can load it as a local file. If glb files support your use no problem. If not my next idea might be either complete nonsense or still not fulfill your use case, so just ignore if necessary

Can you convert your file of assets to a base6m4 string?

If so the your js file could be

model = [];
model[0] = "base64string0";
model[1] = "bas64string1"
etc.

You could, of course, keep each string in a separate file.