Alternate Blinking Layers in After Effects
by nathan on July 29, 2009
I was looking for a simple way to alternate 2 layers for a simple flapping cape animation.
I came across this expression to set a layer to blink. I figured out how to modify it for the effect I wanted.
Add the following expressions to opacity:
Layer 1
blinkSpeed = 2;
t = (Math.cos (blinkSpeed*time*Math.PI*2)+1)/2;
v = linear(t, 0, 1, 0, 1);
Math.round(v)*100
Layer 1
blinkSpeed = 2;
t = (Math.cos (blinkSpeed*time*Math.PI*2)+1)/2;
v = linear(t, 1, 0, 1, 0);
Math.round(v)*100
Notice the change to the “v=linear” number order.
I’m sure this is out there somewhere but I couldn’t find it.
5 comments
Seems like a useful expression thanks for sharing. Fee like I need to start to using more expressions in my work.
by Brad Chmielewski on Wednesday, 29 July 2009 at 9:52 am. #
Thanks Brad!
Expressions are great in AE. What I figured out today allowed me to create that animation in one composition rather than the three I was previously doing. It really simplifies things.
Expressions also allow me to use the analytical side of my brain along with my creative side.
by nathan on Wednesday, 29 July 2009 at 10:01 am. #
Hi, thanks for sharing this expressions.
Do you know what to do If I want to use tree layers?
by ema on Monday, 3 May 2010 at 10:08 am. #
How would I modify this to cycle between 5 layers?
by Mike on Wednesday, 19 May 2010 at 12:47 pm. #
I can’t find the RSS button for your blog to subscribe to? Do you have one, or am I just blind?
by Eugene Harsha on Tuesday, 15 June 2010 at 5:24 pm. #