Babylon animation vs animationClip

Recommended Posts

While fiddling around with the examples, I opened the dummy3.babylon of the weighted animation example and found that it does not have "animation", but has animationClips? Trying to access animation through the animations property gives you an error as the property is undefined, but you can get the animationClips from the AnimationRange method. I am curious how this is possible and the pros and cons.

Share this post

Link to post
Share on other sites

Hi @MadnessOfMadara.  An animationClip in Babylon.js is an AnimationGroup.  This allows you to have a set of animations that are separated from a mesh.  The advantage of this is that you can apply the animation group to multiple meshes.  You would have to make sure that the properties that the animation group targets are available on the mesh.  The other advantage of an AnimationGroup is that collections of animations can be played simultaneously, and you can specify the range to play the animations.

You can also apply animations directly to the mesh, but you lose the flexibility of sharing the same animations to other meshes.  Plus you would have to rely on the scene to play all the animations.  Though this is fine as long as you do not need to share animations.


Here is a sample playground:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.