Is there a way to transfer animation data into Babylon from external?

Hey folks,

Just wondering is there a way to transfer barebone animation data (for example, keyframes, animation curves) from outside of Babylon?

For example, for a mesh, I create an animation (key frames and curves) in Unreal. I want to export that animation only out of Unreal. Then I want to import the animation data into Babylon, and retarget/reapply the animation to any other models in Babylon.

In an ideal world, if I can transfer the animation curve over instead of baking the animation to every frame, it would be even better.

The model can rigged or not rigged. I am open for this part.
Just wondering if there is a good way to transfer animation between Unreal (or other platforms) and Babylon.

Many thanks,
Tawibox

In most Babylon exporters (for Maya, 3DSMax and Blender) you usually have the option to export a .babylon file or a .glb/.gltf file with only the animation information:

Once you have a file with the animation information you will have access to the animation groups and the individual animations during import (see playground bellow):

Babylon.js Playground (babylonjs.com)

Once you have the individual animation you can just create new Animation groups and assign them to new targets.

I don’t think we have any Unreal Engine plugins at the moment, but if you are able to import your animations into Blender/ 3DSMax or Maya you can than use the Official Babylon exporters:

BabylonJS/Exporters: Exporters for Babylon.js and gltf file formats (github.com)

1 Like

@srzerbetto

Thank you very much for the response!

So is the gltf the only format officially support animation data transferring?

I’m using Mac for my dev env. Since the exporter doesn’t have a Mac version yet, its a little not efficient for me to test the gltf exporter.

Also I am trying to find a scriptable way to transfer the animation data.

If there are any other ideas or suggestions please let me know.
Many thanks again.
Tawibox

3ds Max doesn’t support Mac OS, so there will be no special exporter for Mac.
I don’t use Unreal but the most of popular 3D file formats support animation data export. GLTF/GLB is just the most convenient for Web.

If you want to export GLTF from Unreal here is a couple of links:

1 Like

@tawibox , also to complement the previews answer, if your glb/gltf file has more data (mesh, materials, …) but you are only interested in the animations, you can use:

BABYLON.SceneLoader.ImportAnimationsAsync

It works very similarly to SceneLoader.ImportMesh but it will only import animations.

1 Like

@srzerbetto @labris

ok cool. thanks folks! Looks gltf is a known stable solution. I will start from gltf then.

Many thanks again!
Tawibox.

1 Like