ImportMesh with a .GLB DataURI

Hello,
I’m trying to use to create a ‘oneFile’ including both .js scripts and 3d glb objects (stringified) in my game
The documentation of importMesh :
Specifies that I can use

a string that defines the name of the scene file or starts with “data:” following by the stringified version of the scene or a File object

So i’m using the url-loader plugin for webpack, and give the dataURI string to importMesh third param

Here is an example:
https://playground.babylonjs.com/#8PXL2A#1

However it does trigger an error, it’s trying to JSON.Parse the dataURI, I don’t know why.

Am I missing something, or did I misunderstood the "following by the stringified version of the scene " part ?

Thank you !

Hi. Try with this
https://playground.babylonjs.com/#7F6S08#9

1 Like