Skip to main content
Community Expert
June 19, 2023
Question

Can you directly access keyframe velocity with an expression?

  • June 19, 2023
  • 1 reply
  • 375 views

I use Interpolation methods in expressions all the time. Anyone who has read my posts on expressions will see ease(t, tMin, tMax, value1, value2) or the other variations in a lot of my posts. My problem, I want more. I want something like this:

key1 = marker.key(1).time;
iV = 40;// incoming velocity
iI = 50;// incoming influence
oV = 90;// outgoing velocity
oI = 100;// outgoing influence
k1 = interpolation(iV, iI, oV, oI, [100, 100]);
key2 = marker.key(2).time;
iV2 = 20;// incoming velocity
iI2 = 10;// incoming influence
oV2 = 40;// outgoing velocity
oI2 = 100;// outgoing influence
k12 = interpolation(iV2, iI2, oV2, oI2, [500, 900]);

 Ideally, that expression would give you the same speed curve that you would get if you opened the keyframe velocity for the first two position keyframes and entered the appropriate values.

 

Any ideas out there, or should this be a feature request?

1 reply

Mylenium
Legend
June 19, 2023

The velocity is the tangent vector and can be calculated with the cross product of the input values andf from there it could be decomposed back to its components. Doable, but you'll likley have to fiddle around with some extra math and treat the individual curves as 1D components or it drives you bonkers. Having this built-in would probably be a good day indeed.

 

Mylenium