Best way to blend animations between multiple glTFs?

I have a limitation in my workflow that’s giving me some issues with figuring out how to use multiple animations and blend them successfully. I’m creating my models myself and using Mixamo for animations (as I really don’t know much about the asset creation side of games) and Mixamo only provides one animation per .gltf file.

Basically my assets look something like:

  • idle.gltf
  • walking.gltf
  • running.gltf

and each file contains the entire mesh/skeleton/animation information.

How can I import these into BabylonJS such that I can easily change between idle/walking/running? I would like to avoid reloading the entire character model if that’s possible. Is there a way I can load all of these files, extract just their animation information, and copy that over to the primary “idle” mesh to play at a later time? Thank you for any help!

1 Like

Welcome to the forum Blake.

Search on playground search: Babylon.js Documentation

Until you find something like this:

: )

@aFalcon thank you for your response! Unfortunately I’m stuck with using .gltf files as the blender babylon exporter doesn’t work well with the fdx importer (due to transformations it places automatically).

Calling getAnimationRange on the gltf loaded skeleton seems to return undefined for me however. If I open the .gltf file, it lists three animations with the properties:

        "name": "Armature|Idle",            
        "name": "Armature|Running",
        "name": "Armature|Walking",

But passing both “Walking” and “Armature|Walking” to getAnimationRange returns undefined. Any ideas how to load named animations from glTF?

1 Like

Figured it out!

For future travelers - the solution for me was to call task.loadedAnimationGroups[idx].play(true); to start playing and looping each different animation!