GLTF2Export.GLBAsync not working as expected


We used the code above to try to export our scene to a GLB format but we keep getting files of less than 2MB. We are expecting much larger, like 50MB. We also get this validation error when trying to open up the produced GLB’s:

Can someone please help?
Thanks,

1 Like

Welcome aboard!

Are you able to provide a repro somwhere, either in the Playground or a github project? It definitely looks like a bug but without a repro it will be hard to find.

Hello! Thank you for responding so quickly:) We reproduced the potential bug in this repository:
https://github.com/tim-r-cruz/babylon-glbExport-bug
Let us know if you have any more questions!
Thanks again,

Could you not repro in the playground instead ??? this would help the full community to jump on the issue.

Hello! We’ve been trying to recreate it in your playground, but haven’t been able to. Here is the code in a sandbox for react projects if that is more helpful to you:
https://codesandbox.io/s/strange-edison-bmix8c?file=/src/MorphView.tsx
We think it might be a React specific issue?

You must not mix the types / versions of packages:

    "@babylonjs/core": "^5.26.1",
    "@babylonjs/loaders": "^5.26.1",
    "babylonjs": "^5.26.1",
    "babylonjs-inspector": "^5.39.0",
    "babylonjs-serializers": "^5.39.0",

Use this instead:

    "@babylonjs/core": "^5.39.0",
    "@babylonjs/loaders": "^5.39.0",
    "@babylonjs/inspector": "^5.39.0",
    "@babylonjs/serializers": "^5.39.0",

and update MorphView.tsx:

import {
  GLTF2Export,
  GLTFData,
} from "@babylonjs/serializers";
import '@babylonjs/inspector';

With those changes it does work for me.

2 Likes