import { GLTF2Export } from ‘babylonjs-serializers’;
export const exportGLB = async (scene: Scene, fileName: string) => {
console.log(exportGLB===>, scene);
GLTF2Export.GLBAsync(scene, fileName).then((glb) => {
console.log(glb===>, glb);
glb.downloadFiles();
});
}
I used the above code to export the scene, and all resources have been loaded and materials have been assigned by default.
However, when the model is loaded in Three.jseditor, only attributes, materials, and other information are lost
I don’t know what’s going on here
The issue likely stems from incomplete resource loading or incompatible material definitions between Babylon.js and Three.js. Verify resource loading before export, simplify the scene to isolate the problem, debug material definitions, and ensure you’re using the latest dependencies. If possible, provide a minimal reproducible example for more accurate diagnosis.