FORUMS: list search recent posts

Creating On/Off Switch or Expression for Multiple Sub Comp Layers Visibility

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Simon Brown
Creating On/Off Switch or Expression for Multiple Sub Comp Layers Visibility
on Aug 22, 2013 at 6:57:30 pm

Please Help...

I am a relatively experienced user of After Effects; predominantly motion graphics for television.
I have a project where I have taken stills of an actors face as freeze frames and animated them to fit a lip sync, this has allowed me to pick various humorous gestures, with the intention of switching between them (all stacked on top of each other) when the delivery requires.

So I have 20 different face gesturers all stacked in a sub comp called "Faces".
I want an expression that I can use on the master timeline called "Scene 01" that has "Faces' within it, that will basically keyframe these different layers to turn on visibility when activated and turn all others off.

So if I turn on the visibility of the 'Happy Face' layer (layer 3 in "Faces") I can switch to the 'Sad Face' (layer 8 in "Faces") and it will override all other layers turning them to 0% opacity but making the chosen selected layer 100%.

This needs to be a simple keyframe system as the gestures will change regularly as the delivery requires them to, so I was hoping to just 'toggle' or 'switch' some how as the sequence delivers.

Please help, as I have tried various attempts at this and am losing the small remaining hair I have left!

Thanks so much in advance!!!!

Simon
Holey and Moley


Return to posts index

Dan Ebberts
Re: Creating On/Off Switch or Expression for Multiple Sub Comp Layers Visibility
on Aug 22, 2013 at 7:13:51 pm

You can't do it with an expression in your main comp, so you'll have to use an opacity expression on each of the layers in your Faces comp. This expression assumes that there's a layer named "controls" in the main comp that has a slider keyframed (hold keyframes will work best) to the layer number of the face layer that should be visible:

C = comp("Scene 01");
ctrl = C.layer("controls").effect("Slider Control")("Slider");
L = C.layer(thisComp.name);
val = Math.round(ctrl.valueAtTime(time+L.startTime));
if (val == index) 100 else 0


Dan



Return to posts index

Simon Brown
Re: Creating On/Off Switch or Expression for Multiple Sub Comp Layers Visibility
on Aug 22, 2013 at 7:26:12 pm

...wow Dan,

Genius, it works exactly as I needed and is so simple, thanks for shedding light and sharing the knowledge its much appreciated!!!!

Cheers now,

Simon
Holey and Moley


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]