ADOBE AFTER EFFECTS: Forum Expressions Tutorials Podcasts Creative Cloud

Simple swap of layer

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emeric ThoaSimple swap of layer
by on Sep 29, 2010 at 12:11:11 am

Hi guys,
I need help. Deeply. I'm new to AE, and I was ready to love it, but after a full day not being able to a do simple "blinking" animation on a cartoon character, I might as well go back to Flash.

So please help me. Here is what I want to do:
- I have a .png character on one layer.
- This character is kinda "floating" (imagine a little ghost)
- I want the character's eyes to "blink" randomly over time. For this I have another layer with the blinking character.

What I tried so far:
- I do a wiggle on the main .png layer
- I set the opacity of the "blink" layer to 0
- I set the parent of the "blink" layer to the main layer

so far, works great, my character is floating eyes open. If I change manually the opacity the blink layer appears at the same random position as the main layer.

I have hard time to make it randomly blink over time though.
I have tried this expression:
r = random (1,60);
if (r>3) opacity = 0;
else opacity = 100;

Works nice, but the "blink" effect only stays for a frame, and I would like to delay it for about a second.

So if you have any idea ? Another BIG question is : how to do a basic swap of layers? Is the opacity the only way (set layer 1 to 0, layer to 100 and then invert?). I would soooo need some better way to do this, and I have been reading thousand of pages on the web without finding a good solution.

Thanks a lot.

Return to posts index

Michael SzalapskiRe: Simple swap of layer
by on Sep 29, 2010 at 1:27:03 pm

Flash is often preferred for character animation, but I think I can help you out.
Check out this tutorial. It should get you what you need.
I found it by using this awesome AE community search (there are lots of other links there that should help you like tutorials on animating a walk cycle and inverse kinematics).

Also, for someone new to AE, these resources should help build your basic knowledge to help avoid frustration in the future. More here once you've got those mastered.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

Return to posts index

Kevin CampRe: Simple swap of layer
by on Sep 29, 2010 at 3:38:32 pm

to get the blink to 'hold', you could use posterizeTime()...

posterizeTime(2); // the value is in times per second; 2 x per second is a half second duration
r = random(60);
if (r>3) 100 else 0;

[Emeric Thoa] "Another BIG question is : how to do a basic swap of layers?"

there is an effect called compound arithmetic that will let you take any layer in the comp and composite it on the layer that the effect is applied to. it has an opacity property that would let you toggle between the seeing the original layer and the second layer.

as with most compound effects, you can get some oddities if the layers are not the same size, but most of those can be overcome with precomping (so the layers are the same size as the comp, and positioned relative to the comp).

and to add to michael's links (i don't think he included this one), dan ebbert's has an example using expressions and layer markers to drive character animations:

Kevin Camp
Senior Designer

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 All Rights Reserved