How to use the exported animation JSON file ? Can we use this JSON file and apply the animation on another mesh?

Hello Babylonjs family. :grin: :pray:

I imported a model in the sandbox which had an animation. I clicked the save animation button which in turn downloaded a JSON file.
File - Dropbox - animations.json - Simplify your life

I want to use this animation on another model. Is there a way to use this json file for the desired task.
If not, Is there any other way of replicating the animation of a model to another model ?

Please help :pray:

Hello!

Hmmm what exact “save animation” button did you click?

2 Likes

hello @carolhmj,
Sorry for the confusion, Here is the what i did
clicked on one of the animations and then clicked edit,


followed by - clicking on save button and save file.

which resulted in a download, JSON file - Dropbox - animations.json - Simplify your life

Now i was wondering can i apply this animation on another mesh model.
Or is there a way of copying animations form one mesh model to another ?

Please help! :smile:

Oooh thanks for the clarification! Yes, you can use the ParseFromFileAsync method to load any animation: Animation | Babylon.js Documentation (babylonjs.com). However, your example seems to be exporting a single channel from an animation group, so if you just load that single channel into another mesh, the results might not be what you want.

2 Likes

thanks @carolhmj , so should i try to donwload the whole animation instead of a single channel ? i don’t see any options for that.
Also there another way to replicating the animation to another mesh model ?
:sweat_smile: :sweat_smile:

The process of replicating the animation in another model is called retargeting, and it’s quite a common process, we’ve had a few topics over time about it with good advice: Anyone figured out retargeting yet? - Questions - Babylon.js (babylonjs.com), GLB blend animations and meshes in different files - Questions - Babylon.js (babylonjs.com). It also depends on how your animation is defined (if it’s bones, morph targets, etc etc…), are you able to share the model file?

2 Likes

hey @carolhmj , I’ll surely try to implement retargeting. Thanks for the links.
Here is the model that i’m using - LOTUS ÉLISE - Download Free 3D model by Stéphane Agullo (@sa3d) [75e9045] - Sketchfab

Thanks for sharing! Yeah, looking at how this asset is defined, if you want to reproduce the entire car trajectory, you’ll have to retarget the entire group, exporting and loading a single animation will not work as you expect. Also, the asset is defined in quite a particular way, so be warned that if the other mesh you want to replicate the animation on is defined with a different hierarchy, etc, you’ll have to consider all of this in your retargeting.