Proper framerate/ frame/ to/ from values for animation blending?

So I am trying to animate rotation and position at the same time, but the animation blending only goes half way. I have two animations the are 30fps and both animations have only two frames, one at frame 0 and one at frame 30. I try to use beginDirectAnimation but they only play halfway and then stop, never reaching the final values.

Here is a playground that demonstrates this. https://www.babylonjs-playground.com/#24SBV7#19

The box should move to z=5 but only reaches ~2.8 or so. I discovered that by making the animations 15 fps they complete normally, or by making the last frame 60 and the from value 60 then it works, but I don’t understand why.

Can someone please explain this to me? Thanks.

This might be explained by the fact in blending it blends from the current state. I guess in your case you simply do not need blending :slight_smile:

Ping @Deltakosh to confirm ?

@sebavan is right, You are enabling blending animations which means that the system will take the current state and blend it with the value from the animation but as the animation is too short, it does not have time to reach out a state where 100% of the animation is used ending up with a state where only 70% of it was used

here is a easy fix: https://www.babylonjs-playground.com/#24SBV7#20 (speeding the blending speed)

But even better: Are you sure you need blending animations? https://www.babylonjs-playground.com/#24SBV7#21

Wow, thanks guys. I think I have completely misunderstood what animation blending is. For some reason I thought it was necessary to enable that just to run two animations simultaneously.

So now I have a question: What is animation blending used for? Is it for when you don’t know the starting state so you can animate stuff dynamically? What is an example of when that would be necessary?

Thanks.

Yes exactly, animation blending is when you don’t know about the current state.
Like here: https://www.babylonjs-playground.com/#BCU1XR#0
or there: https://www.babylonjs-playground.com/#LL5BIQ#0