ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

using a layer's visibility in an if/then expression on another layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mel ruiz
using a layer's visibility in an if/then expression on another layer
on Jan 16, 2018 at 8:17:12 pm

What I'm trying to do is include an if statement in a position expression that is looking up the visibility of a layer. So that if a layer is hidden (with the "eye" turned off) then the position will be different than if it is not hidden/turned on. I can't use opacity, as people will be either leaving a layer on or hiding it and I need my expression to account for that choice.

I can't seem to find out how to call out a layer's visibility in that way...maybe it's not possible? Anyone know? thanks!

AE 2017


Return to posts index

Kevin Camp
Re: using a layer's visibility in an if/then expression on another layer
on Jan 16, 2018 at 8:50:19 pm

the attribute you are looking for is 'active'.

try this:

target = thisComp.layer("My Layer") ;
p1 = [ 100, 100 ] ;
p2 = [100, 400 ] ;
if ( target.active == true ) p1 else p2 ;

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Dan Ebberts
Re: using a layer's visibility in an if/then expression on another layer
on Jan 16, 2018 at 8:50:36 pm

Here's a position expression that will move the layer 100 pixels to the right if Layer 1's eyeball is on:


if (thisComp.layer("Layer 1").active)
value + [100,0]
else
value



Dan



Return to posts index


mel ruiz
Re: using a layer's visibility in an if/then expression on another layer
on Jan 17, 2018 at 1:16:40 am

That is EXACTLY what I wanted. Thank you both!


Return to posts index

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