Load scene .gltf or .obj - error, but if try .babylon - its ok

Hi everyone. I have a problem with load *.gltf and *.obj files. I use 3dsmax 2020 exporter. When I try load “model.gltf” or “model.obj” with BABYLON.SceneLoader.Load() - get error (Error in onSuccess callback). With “model.babylon” - scene is loading fine.
And i use “babylonjs.loaders.min.js” Thanks!

One thing I know is that a .babylon file requires no extra .js file. So the first thing to check in your browser console is that the url is accurately pointing to a correct place, like this for example

https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js

Next, you are probably going to need to give more color on the error. If it is in the success callback, then get rid of it. If the scene loads, then there is no problem with the load. In that case, the problem is with the callback being specific to how a .babylon loads stuff. Not all formats result in the exact same scene. Gltf has got some “______Rooty _____” thing.

2 Likes

A repro would simplify a lot our research for the issue ? setting in the playground is the best way for a fast answer.

1 Like

Thanks for help, JCPalmer and sebavan I`v founded problem!
In my code i have lines:
const omni = scene.getLightByName(‘Omni001’)
omni.position = new BABYLON.Vector3(0, 0, -15)
and its returns null when I try load .gltf.
Solution is: When exporting from 3dsmax check “KHR_lights_punctual” is true. After it the omni light is load correctly.

2 Likes