0

I was trying to animate something that was scaling exponentially, so I created an fcurve with two keyframes and configured it for exponential easing. It did not behave as I expected.

Consider two keyframes (frame,value): (1,1) and (11,32).

I would expect that to be interpolated as (3,2) (5,4) (7,8) (9,16) , doubling every two frames.

Instead I see (3,1.121) (5,1.484) (7,2.938) (9,8.75) .

What are the equations governing blender's exponential interpolation mode?

Mutant Bob
  • 9,243
  • 2
  • 29
  • 55

1 Answers1

0

The math used can be found here, the calculations for the parameters used can be found here.

The calculation used for exponential ease in is -

change * powf(2, 10 * (time / duration - 1)) + begin

The curve is calculated between a start keyframe (begin) and an end keyframe, time is the time elapsed since the start key and duration is the total time between start and end, change is the amount the keyed value changes between keyframes.

The commit that adds this and the other nine interpolation types to blender contains links to easings.net and robertpenner.com/easing/ as the source of the calculations.

sambler
  • 55,387
  • 3
  • 59
  • 192
  • When I reproduce that formula in a spreadsheet it matches the values I'm seeing. It is somewhat disappointing that the span of the exponent is hardcoded to 1:1024 . – Mutant Bob Sep 24 '16 at 19:58
  • Feel free to submit a bug report that it should be improved or have alternate interpolation options added. – sambler Sep 25 '16 at 03:29
  • When I get some time I think I'll write a math paper about exploiting the fcurve handles to implement an exp(ax+b)+c+dx interpolation, or come up with another formula. – Mutant Bob Sep 27 '16 at 18:39
  • My incomplete research is documented at http://web.purplefrog.com/~thoth/math-papers/exponential-easing/exponential-easing.html . There is considerable work to be done before it can be used as a form of easing in fcurves. – Mutant Bob Oct 13 '16 at 17:01