-
Modify linear expression to use fourth and fifth keyframes of a property
I use this expression structure a lot:
r=transform.yPosition;
k1=transform.yPosition.key(1).value;k2=transform.yPosition.key(2).value;
ease(r,k1,k2,0,22)
Today I’m trying to to the same but instead of using keyframes 1 and 2 y need to use the 4th and 5th, so I wrote this instead:
f=thisComp.layer(“50MM”).cameraOption.zoom;
k1=thisComp.layer(“50MM”).cameraOption.zoom.key(4).value;
k2=thisComp.layer(“50MM”).cameraOption.zoom.key(5).value;
linear(f,k1,k2,100,0);
But when I play the animation the value before the third keyframe is 100, and I need it to be 0 up until the moment it hits the 4th keyframe.
When the 4th keyframe is reached the animation happens as expected.
Thanks in advance for your help.