GLTF Export/Serializer Error

Hey folks,

i am trying to export the babylon scene from my applicationton to GLTF. So i included the serialer js file:

Export should happen after pressing a button

document.getElementById("savebtn").addEventListener("click", function(e){
        BABYLON.GLTF2Export.GLTFAsync(scene, "test.gltf").then((gltf) => {

but i only get some errors

babylonjs.serializers.js:416 Uncaught (in promise) TypeError: Cannot read property 'Warn' of undefined
    at babylonjs.serializers.js:416
    at new Promise (<anonymous>)
    at KHR_lights_punctual../glTF/2.0/Extensions/KHR_lights_punctual.ts.KHR_lights_punctual.postExportNodeAsync (babylonjs.serializers.js:386)
    at babylonjs.serializers.js:1434
    at _Exporter../glTF/2.0/glTFExporter.ts._Exporter._applyExtensions (babylonjs.serializers.js:1413)
    at _Exporter../glTF/2.0/glTFExporter.ts._Exporter._extensionsPostExportNodeAsync (babylonjs.serializers.js:1434)
    at babylonjs.serializers.js:2477

Hey! are you using ES6 module import? Or are you referencing everything from preview CDN?

Looks like the Tools module is not imported

iam using this file from the CDN link on the NPM page

I meant for Babylon.js itself

i am using the 3.3 version from the version builder

Yeah so that’s why. Preview cdn will give you 4.0 code
You need to use 4.0 from version builder

thanks alot!
but now the inspector and the scene explorer are open when a launch my application

You must call somewhere ;D

indeed, my bad :smiley:

1 Like