loop opacity expression?

Moderators: Disciple, zlovatt

Post Reply
sickie
Posts: 1
Joined: October 11th, 2004, 1:31 pm

Hi there!

I am trying to write an expression to control the opacity over time. Can anyone help?

Starting from the in point of the layer (at 00.00.00), after 12f opacity goes from 0% - 100% over 5f hold for 25f and opacity reduces from 100% - 0% over 5f and after 12f this cycle will loop for the duration of the layer (which is not fixed). Thanks!
Last edited by sickie on December 30th, 2004, 9:33 am, edited 2 times in total.
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

I think this works:

f1 = 12;
f2 = 5;
f3 = 25;
f4 = 5;
f5 = 12;

fTot = f1+f2+f3+f4+f5;

f = Math.round(time/thisComp.frameDuration)%fTot + 1;

rampOn = linear(f,f1,f1+f2,0,100);
rampOff = linear(f,f1+f2+f3,f1+f2+f3+f4,100,0);
Math.min(rampOn,rampOff)

Dan
Post Reply