Copy link to clipboard
Copied
Hello everyone,
First time posting. I borrowed this expression from another post and it works if I am only using 2 keyframes, but when I try to adjust the expression to include 4 keyframes so it can animate out, it breaks.
I am basically trying to animate opacity keyframes using a slider. 0% to slider value to slider value to 0%.
I posted a screenshot of my comp and the expression (with error)
Thanks for the help!
Copy link to clipboard
Copied
This should work:
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3).time;
t4 = key(4).time;
v1 = key(1).value;
v2 = thisComp.layer("Controls").effect("Background Transparency")("Slider");
v3 = thisComp.layer("Controls").effect("Background Transparency")("Slider");
v4 = 0;
if (time < t2)
linear(time,t1,t2,v1,v2)
else if (time < t3)
linear(time,t2,t3,v2,v3)
else
linear(time,t3,t4,v3,v4);
Copy link to clipboard
Copied