ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

100 to 0 Expression based on layer length

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Haas
100 to 0 Expression based on layer length
on Oct 29, 2018 at 7:48:45 pm

I've been using this code for a while as a way to fade in and out my layers based on length, so I don't have to keep moving keyframes when adjusting composition length:


// Fade in and out

fadeInTime = .25;
fadeOutTime = .25;

Math.min(linear(time,inPoint,inPoint + fadeInTime,0,100),linear(time,outPoint - fadeOutTime,outPoint,100,0));


I tried to adapt the code and use it on the effect "Gradient Wipe" but it doesn't seem to work:


TransitionInTime = 1;
TransitionOutTime = 1;

Math.min(linear(time,inPoint,inPoint + TransitionInTime,100,0),linear(time,outPoint - TransitionOutTime,outPoint,0,100));


I'm trying to have the transition go from 100 to 0 in one second at the beginning, and then 0 to 100 in one second at the end.

I'm not sure why it isn't working.


Return to posts index

Dan Ebberts
Re: 100 to 0 Expression based on layer length
on Oct 29, 2018 at 7:59:09 pm

Change the last line from Math.min() to Math.max()


Dab



Return to posts index

Adam Haas
Re: 100 to 0 Expression based on layer length
on Oct 29, 2018 at 9:13:15 pm

YES, that was it! Thank you so much.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]