Hi , I’m working on very intersting project right now, and one of the interestion thing of it very tight requirements to size. I have met a problem with SceneLoader
if I import it like this
import {SceneLoader} from “@babylonjs/core/Loading/sceneLoader”
and run
return new Promise(async(resolve)=>{
loader();
function loader(){
let name = models.shift()
console.log(SceneLoader);
SceneLoader.ImportMeshAsync('','',
`models/${name}.glb`,
scene
).then((result) => {
if(!name)return
const root = result.meshes[0]
root.name = name;
if(models.length==0){
resolve(true)
}else{
loader();
}
})
}
})
it is failed with error
Uncaught (in promise) RuntimeError: Unable to load from models/walk-x-bot.glb: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse
However all work well if I import this one
import “@babylonjs/loaders”;
but if sceneLoader size is 439kb when babylonjs/loaders is 1.4 Mb which is too much for my project