Skip to main content
Participant
September 25, 2024
Question

Linear() needs 3 or 5 arguments error

  • September 25, 2024
  • 1 reply
  • 366 views

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!

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
September 25, 2024

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);
Participant
September 26, 2024
Awesome, thanks so much!
______________________________
David Brammell Jr
Teacher
AV Production/Animation
Robert Turner College & Career High School/Pearland ISD
[image001.jpg]

NOTICE OF CONFIDENTIALITY: This electronic mail transmission may contain CONFIDENTIAL INFORMATION, belonging to the sender, which is legally privileged. The information is intended only for the use of the individual or entity listed above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, use, or taking of any action on reliance of the contents of this electronically-mailed confidential information is strictly prohibited and may violate PISD Board policy (legal) and the Family Education Rights and Privacy Act (FERPA). If you have received this electronic mail in error, please notify us by telephone immediately to arrange for return and correction of internal records; in addition, please delete the original message