I have been experimenting with animations in BabylonJS, but I have not been able to get additive animations working properly.
I have followed the Advanced Animation tutorial, and I also looked at the additive animation example.
For testing purposes, I created a simple mesh with a simple rig. Here is a demo:
I created two simple animations: the first animation is an infinite walking loop, and the second animation scales the head up/down.
I want to combine these two animations together, and be able to control them independently (so the walking animation can be played/paused at any time, and the head size can be scaled up/down at any time).
But immediately I run into problems:
While the walking animation is playing, the head animation is completely ignored (which means the slider does not work).
When the walking animation is paused, the head slider now works, except it completely ignores the walking animation.
AnimationGroup.MakeAnimationAdditivethe model completely disappears when pausing the animation and moving the slider.
AnimationGroup.MakeAnimationAdditiveit will clamp all scales to minimum 1, so you cannot have bone scales lower than 1.
If you play the
Head Sizeanimation then blending works, but I do not want the animation to play, I want to keep the head size animation paused (so it can be selected with the slider).
And it still doesn’t blend properly when the walking animation is paused. It seems like Babylon is just completely ignoring paused animations, which is incorrect: it should only be ignoring stopped animations.
Also, the scale is completely wrong, the head is far too big. This is probably related to problem 4.
If you call
playthen it behaves differently than calling
I have tried every combination I could think of. Using
syncAllAnimationsWith does not help. Using
speedRatio = 0 does not work. Using
setWeightForAllAnimatables(0) does not work.
Also, I have tested the GLB file in a glTF viewer and the animations work correctly (but without blending), so I know it’s not an issue with the animations.