Skip to main content
Participant
Sep 25, 2024 9:20 PM UTC
Question

Linear() needs 3 or 5 arguments error

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

Dan Ebberts
Community Expert
Community Expert
Sep 25, 2024 10:01 PM UTC

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);
Translate
Participant
Sep 26, 2024 10:20 PM UTC
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
Translate