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!
loop opacity expression?
-
- 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
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