Struggling to import animated model from Mixamo

Hi all, I’m really new to Babylon (and 3D in general) and am attempting to import an animated character model from Mixamo into my scene. Running into a whole bunch of issues along the way and would appreciate any help, here’s my flow:

  • Miaxmo only offers .fbx so I’m importing into Blender and exporting as .glb (also tried .obj)
  • attempting to load via BABYLON.SceneLoader.ImportMeshAsync('', '/assets/player/', 'walk.glb', this.scene) results in this issue:
Uncaught (in promise) SyntaxError: Unexpected token g in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.importMesh (babylon.js:16)
    at babylon.js:16
    at f (babylon.js:16)
    at e (babylon.js:16)
    at XMLHttpRequest.g (babylon.js:16)
  • so I’m using the sandbox to convert from the .glb file into .babylon and attempting to load via BABYLON.SceneLoader.ImportMeshAsync('', '/assets/player/', 'walk.babylon', this.scene) results in the static model loading into my world, but the animations aren’t there even though they’re clearly present in the .babylon file in the Sandbox, appearing under “Animation groups” in the Scene Explorer

  • I came across this thread assetsManager & loadedAnimationGroups empty which suggests using LoadAssetContainer for animation info, which I’m now doing: BABYLON.SceneLoader.LoadAssetContainerAsync('/assets/player/', 'walk.babylon', this.scene)

but that throws the following weird error and it doesn’t load into my world at all:

GET http://localhost:8080/assets/player/ 404 (Not Found)

I’m pretty lost. What am I doing wrong?

Turns out it was because I was missing import 'babylonjs-loaders';

It’s a pretty un-intuitive error message, I think this should be improved (surprised that no one else has encountered this issue? I did read it in the tutorials but still forgot about it)

Might submit a PR for this later

Hello @sairens!
I am sorry, but you are wrong. :see_no_evil: It is clearly stated in the documentation that you need to add the loaders to your page:

Hey Roland, thanks for replying, what I actually meant was, even though it’s in the docs, I still managed to forget :sweat_smile: so having a more intuitive error message would be a good idea

Yes, I agree, maybe the scene loader should check whether a suitable parser is loaded for the format being loaded. However I bet my friend that you’ll never ever forget to include it again after this sadly inconvenient experience :joy: we are all learning along the way every day…