Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

Turn off sequentially

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
John MadisonTurn off sequentially
by on Sep 26, 2012 at 5:03:17 pm

HI guys,
I would like your help on the following if possible.
I have a set of layers and I want to have an animation where they turn off sequentially in the time line.
So, let’s say I have 20 layers of a square (100x100) positioned on the screen from top to bottom so they appear as arranged boxes. I would like to animate them so that as the time moves forward, they start to disappear from top to bottom. I would also like to control the rate at which they disappear. I am talking about completely off (0 opacity) sequentially.
Im thinking an expression with the index property of each layer and the opacity linked with the time will work, but how?
Thanks


Return to posts index
Reply   Like  

Dan EbbertsRe: Turn of sequentially
by on Sep 26, 2012 at 5:25:44 pm

It will probably be something like this, which should turn the layers off sequentially, starting at 1 second and then every .25 seconds:

tStart = 1;
tDelay = .25;
time >= (tStart + (index-1)*tDelay) ? 0 : value



Dan



Return to posts index
Reply   Like  

John MadisonRe: Turn of sequentially
by on Sep 26, 2012 at 5:59:57 pm

Thanks,

How would i go about reversing it if possible, so that the bottom layer goes off first instead of the top layer?


Return to posts index
Reply   Like  


Dan EbbertsRe: Turn of sequentially
by on Sep 26, 2012 at 6:05:54 pm

If all layers in the comp are participating, it would be like this:

tStart = 1;
tDelay = .25;
time >= (tStart + (thisComp.numLayers - index)*tDelay) ? 0 : value


Dan



Return to posts index
Reply   Like  

John MadisonRe: Turn of sequentially
by on Sep 28, 2012 at 6:17:06 pm

Thanks Dan!

I thought I had it, but not quite! What I wanted was the layers to turn on sequentially and then off again sequentially.

So in the set-up, I have 20 layers arranged top to bottom. I would like them to turn on one by one and then once all are on, they start to go off again sequentially.

I thought the expressions above would do it with some tweeking but finding it really difficult!


Return to posts index
Reply   Like  

Dan EbbertsRe: Turn of sequentially
by on Sep 28, 2012 at 10:32:08 pm

Like this maybe:


tStart = 1;
tDelay = .25;
if (time < tStart + thisComp.numLayers*tDelay)
time >= (tStart + (index-1)*tDelay) ? value : 0
else
time >= (tStart + (thisComp.numLayers + index-1)*tDelay) ? 0 : value;



Dan



Return to posts index
Reply   Like  


John MadisonRe: Turn of sequentially
by on Sep 29, 2012 at 4:01:23 pm

Many thanks Dan, but its still not quite what i wanted. I should've explained better.

I want them to turn on from bottom up and then turn off immediately after from top down.


Return to posts index
Reply   Like  

Dan EbbertsRe: Turn of sequentially
by on Sep 29, 2012 at 6:22:55 pm

Try this:


tStart = 1
tDelay = .25;
if (time < tStart + thisComp.numLayers*tDelay)
time >= (tStart + (thisComp.numLayers-index)*tDelay) ? value : 0
else
time >= (tStart + (thisComp.numLayers + index-1)*tDelay) ? 0 : value;



Dan



Return to posts index
Reply   Like  

John MadisonRe: Turn of sequentially
by on Sep 29, 2012 at 11:51:00 pm

perfect!


Return to posts index
Reply   Like  


Navarro ParkerRe: Turn of sequentially
by on Oct 1, 2012 at 10:34:37 pm

How about an expression where all layers start out visible. Then sequentially, each layer blinks off then comes back on before the next one blinks off, then back on.

such as this:


Return to posts index
Reply   Like  

Dan EbbertsRe: Turn of sequentially
by on Oct 1, 2012 at 10:58:47 pm

Something like this maybe:


tDelay = .3;
tOff = .1;
tOn = .2;

idx = Math.floor((time - tDelay)/(tOff+tOn));
if (idx == (index -1))
if ((time - tDelay)%(tOff+tOn) > tOff) value else 0
else
value



Dan



Return to posts index
Reply   Like  
+1

Navarro ParkerRe: Turn of sequentially
by on Oct 1, 2012 at 11:20:35 pm

Works like a charm! Thank you!!


Return to posts index
Reply   Like  


John MadisonRe: Turn of sequentially
by on Oct 3, 2012 at 6:06:29 pm

Thanks Dan, but I have another question if you dont mind!

I am trying to run a parallel expression to the one you gave me above (turn off sequentially from bottom up and then back down again). I am using the brightness effect to dim the layers that are visible, but I dont want it to affect the top visible layer.

So the idea is the layers turn on from bottom up but they are all dim (for arguments sake this is set to -1) except the top layer which is still unaffected. I tweeked your expression and it works the first time around (i.e when they are turning on from bottom up) but not when they are turning off from top down. Is this making sense?


Return to posts index
Reply   Like  

Dan EbbertsRe: Turn of sequentially
by on Oct 3, 2012 at 9:09:25 pm

I would think something like this would work:


for (i = 1; i <= thisComp.numLayers; i++)
if (thisComp.layer(i).transform.opacity > 0) break;
if (i == index) 100 else 0


Dan



Return to posts index
Reply   Like  

Navarro ParkerRe: Turn of sequentially
by on Oct 8, 2012 at 9:52:25 pm

How about the opposite of this? So it's just one layer visible at a time?

Photobucket


Return to posts index
Reply   Like  


Dan EbbertsRe: Turn of sequentially
by on Oct 8, 2012 at 10:54:40 pm

Something like this maybe:


fOn = 3;
fOff = 1;
f = timeToFrames(time);
idx = Math.floor(f/(fOn + fOff));
if (idx == (index -1))
if (f%(fOn+fOff) >= fOn)
0
else
value
else
0



Dan



Return to posts index
Reply   Like  
+1

Navarro ParkerRe: Turn of sequentially
by on Oct 8, 2012 at 11:37:37 pm

Works great! Thank you.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]