Additive animations bugs with blending animations

I am working on a project that using a lot of character animations and additive animations.
The problem is that when animations change quickly, additive animations seem to be added a second time. You can see it in the playground if you set sadpose to max and quickly press run and walk. For example I set blendingSpeed to low 0.001 so you can see it clearly, usually it set to 0.045. I know if I change animation using weight this problem dissappear, but quality is less. Is there a way to fix it?

cc @Evgeni_Popov

What you want to do can’t work with the way blending work. It’s easier to understand with an example:

Let’s say you have animation A (“walk” for the position property) and B (“run” for the position property) for which you’ve enabled animation blending. And you also have animation C (“sad”), which is an additive animation and which is enabled at start.

When you start A, the current position is saved, so that during animation we can lerp between the current computed value of the animation and the saved position (the lerp factor is the blending factor). The final position set for the transform node targeted by the animation is the position calculated from A plus the position coming from C.

Now, you start B and stop A. The same process described above applies to B, meaning that the saved position when B starts is the current position of the transform node, which is the position calculated from A PLUS the additive part coming from C. The problem is this additive part that comes from C when we saved the value: as we are going to add the current position computed from C, we will have two times the contribution from C. For this to work, we would need that the contribution from C is not taken into account when we save the current position of the animation when we start B, which is not possible.

However, I think you can do what you want be simply updating the weight of A and B in opposite direction (so, not using blending). When you start A, starts from a 0 weight and increase it regularly. When you start B, start B from a 0 weight and increase it while you decrease weight of A until it reaches 0, at which point you can stop A. That’s what this PG (from the doc) does:

1 Like