Has MeshLoader got a new bug recently?

Hi everyone,

I am making a webpack app, I got everything setup properly (the gltfs that I import, the webpack config was working great and all that), I had a xr scene with some gltfs and a couple mes but nothing too crazy. I ran the code around a week ago and everything was working as intented but today I npm run start and the loader tells me RuntimeError : Unexpected Magic 5388970747
Unfortunately I can’t really provide a playground since the meshes are generated through an api call with credentials and all that but I’d hope someone knows what could be happening.

Do not hesitate to ask for precision

Regards

Did you update Babylon before having this issue? Maybe try to reinstall the node_modules just in case!

Do you know which version of Babylon causes this error and what is the Babylon version number which works fine with your code?
Are you sure that Babylon and Babylon loaders are of the same version?
What happened between a week ago and current time? Did you update something and what did you update and how?

this would normally mean you are not loading a gltf file ? most of the time a not found/error page in place of the gltf url you are loading.

Hi, thanks for your questions, The version of babylon is 7.12.0 and the version of the loader is 7.10.0 I removed and reinstalled node_modules just in case

Hi mate,

I also thought about the path being wrong but it was working a week ago with the same path and I did not modify the architecture. I am loading the data synchronously but I will try asynchronously.

Maybe try to have the same engine and loader version, it can create issues sometimes

Oh, ok, thanks mate, Ill try this today

Hi guys,
I found something that works for me, here is what I was doing

let mesh;

SceneLoader.ImportMesh(' ', rootdir, url, m=>{/*some function execution here*/})

It was working a couple days ago but it is not the case anymore. Now I save the uniqueId of my mesh and I use the scene.onDataLoadedObservable

Just to understand better:
You have a rootDir then a URL. But this URL should be the file name not an url.

Couldn’t that be the problem?

It should be:

SceneLoader.ImportMesh("", "./rootDirMesh/", "fileMesh.gltf", m=>{/*some function execution here*/})

And for the name, you put a space ?
ImportMesh(' ', ...

but that’s not correct. There shouldn’t be any space. This could also be a problem.

It should be :

ImportMesh('', ...

I’ve used ImportMesh with .stl and .obj files. With those loaders, it is fine to put the entire url in the “file” parameter with the “root” parameter an empty string. I agree the name parameter also needs to be an empty string if you’re expecting to load all meshes in the file. I’m guessing the root parameter is there to give a sort of base url so that filename and filepath references within the loaded file (e.g. material or texture files) are relative to that base url.