• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Linear() needs 3 or 5 arguments error

New Here ,
Sep 25, 2024 Sep 25, 2024

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)

Screenshot 2024-09-25 161454.png

Thanks for the help!

TOPICS
Expressions

Views

94

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2024 Sep 25, 2024

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 26, 2024 Sep 26, 2024

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines