Scene exporter is not working correctly (19.0 KB)

I’m trying to export the scene using the command

BABYLON.GLTF2Export.GLBAsync(scene, "fileName").then((glb) => {

but it seems to have some errors when I import in blender. Even the other formats like gltf or .babylon is not working.

What would be the problem?

Find attached the glb file

Could you share a repro in the playground ? so that we can have a look into it easily.

cc @bghgary

Because in my project has some backend in it, I tried to compile the parts that might have a problem in the playground.

Here it is: Babylon.js Playground

Another strange thing happened. In that playground, the export does not work but when I remove lines from 43 to 50, the exporter works, but the file is still corrupted

No Export is expected as you create an empty texture here

impact.material.diffuseTexture = new BABYLON.Texture("", scene);
                          impact.material.diffuseTexture.hasAlpha = true;

so it will never load.

But what is not is that a material with a texture is losing it on export: @bghgary could you have a quick look ?

I realized that the materials of merged meshes is not transferred to glb:

I am not sure if we support multi material in the exporter but @bghgary will be able to confirm when he ll look into the texture issue :slight_smile:

I have the texture issue fixed. It looks like we support MultiMaterial, but it doesn’t appear to work correctly with your PG. Will investigate.

1 Like

PR: Export glTF material fixes by bghgary · Pull Request #12239 · BabylonJS/Babylon.js (

This will fix both issues.

1 Like

And also I am having problems with some nodes when exported like this one: Babylon.js Playground

It is importing well, but when I export, some nodes disappear

I don’t know what you mean by this.

I dont know the right term for it but if you see the exported file, some faces of the mesh disappearsed.
But now it seems that the PG is working fine. The issue is fixed. Thank you

1 Like