Errors when trying to load draco compressed mesh

I draco-compressed a mesh using gltf-transform and now I’m getting errors thrown when I try to import it to my scene (uncompressed version works):

and here’s that unnamed function (not really sure what this file is):

Oddly enough, this GLB works in the sandbox and the playground: https://playground.babylonjs.com/#XTNXFT#6

And here’s the compressed GLB: boxcar/assets/models/treeOpt.glb at main · ThomasBurgess2000/boxcar · GitHub

The fact that it works in the playground makes me think there is some sort of draco decoding module that I’m missing locally, but I’m not sure what it is.

I believe something is missing from your imports.

This post should help you:

Hmm, unfortunately adding

import '@babylonjs/loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression';

to the top of my file did not work.

The error that post is discussing is also different than the one I am getting, I believe my code does have access to the extension already.

Indeed, it’s not the same problem. The function linked above is:

It is named decodeMesh, I don’t understand why there’s no name in your screenshot…

Could it be a bug of the packager you use? Are you able to setup a repro somewhere?

Hey, I have the same problem too. Have you been able to find a solution? I managed to load the file with LoadFile() from @babylonjs/core, but then trying to decode the Draco mesh I got “Not a Draco file.” even thought the file is indeed a draco-compressed glb mesh and it loads ok in the playground. I’m supposing the issue here might be with the extension. As you do, I retrieve the meshes from the network and then I create a url for the blob, on which I cannot specify any extension. Providing the loader manually with the same file but with an extension, actually works. Any thought?
Here some more details on the options I’ve tried compression - Error while loading Draco-compressed mesh (glTF-Transform) in BabylonJS - Stack Overflow

Here is the PG example with Draco mesh loading from blob - https://playground.babylonjs.com/#FIWM5X#45

After debugging BabylonJS’ core I discovered that using “.glb” was right and it was using the correct loader (glTFLoader ), but there was a version mismatch in babylon’s imports causing a function not to be found, namely, _decodeMeshToGeometryForGltfAsync()

1 Like