it appears that the speedRatio signage is applied to the value of of the key frame. so when i make it a negative number, instead of scaling in, it scales out.
is this by design? All of the documentation I’ve seen indicates the speedRatio is about speed of animation. I guess when going backwards in an animation, to reverse the operation, negating the value in the key is how you do it.
I feel like speedRatio should be an absolute value, and the engine determines neg/positive depending on if frame From is < frame To.
also, a helper .reverse() (or .playReverse) function might nice. right now to start an animation, you invoke .start(). to reverse, you have to use .start(true/false, speed, from, to)
Well this is how it is intended to work
Speed can be negative to go back in time
It was initially only a positive value but per users demand we allowed it to be negative to go backward as it was apparently the more obvious way for a majority of users
I guess I’m confused about the definition of backward.
to me, when i say “reverse an animation” i basically mean flip the keys, so it goes from last to first.
but maybe people mean a negative speed should invert the effect?
I created a PG to help illustrate the different effects possible.
If you notice, Play and Reverse keys look proper.
going from key 0 to 100 with a negative speedRatio (-1) though, seems to reverse the scaling to go out to 2.5 times, which I don’t know where that math comes from, tbh. it also ignores the looping value, and keeps looping. (its set to false)
thanks to your update last night, using negative speedRatio with keys 100 to 0 doesn’t cause an error, and it properly reverses the animation keys.
but the inconsistency with the forward with negative remains. not sure what is expected behavior.
This is definitely a bug. Your PG should work.
It will be fixed with next nightly (but not before Monday as I’m in a airport now with a terrible connection)
Sounds good. Does that mean the preview babylon.js will also be updated? Or is that a different release cycle?
Also, I kind of like the inverse thing as a feature. No idea if that’s something the community cares for, but take the animation and multiply the value by -1 / vector3.negate sounds like a way to save creating a brand new animation for that.