Activity › Forums › Adobe After Effects › how to get Layer visibility to affect other layer’s opacity
-
how to get Layer visibility to affect other layer’s opacity
Posted by Aled Rhys jones on December 19, 2006 at 10:42 amHi,
I’m hoping to set an expression to get a layer’s opacity to be 90% if another layer’s Visibility (the layer show/hide eye icon) is on, and 100% if off.
I suspect it’s something along the lines of:
if(comp(“Comp 2”).layer(“Layer 3”)=isVisible) 90 else 100
but don’t know my Java Grammar that well.
hope you can help,
Many thanks
Aled
Mylenium replied 19 years, 5 months ago 4 Members · 10 Replies -
10 Replies
-
Mylenium
December 19, 2006 at 12:07 pm[aled] “if(comp(“Comp 2”).layer(“Layer 3″)=isVisible) 90 else 100”
if(comp(“Comp 2”).layer(“Layer 3”).isVisible == true){90} else {100} should work better.
Mylenium
[Pour Myl
-
Aled Rhys jones
December 19, 2006 at 12:38 pmThanks Mylenium, unfortunately though i get the message:
“Class ‘Layer’ has no property or method named ‘isVisible'”!have I got a wrong setting or something?
Aled
-
Mylenium
December 19, 2006 at 1:00 pmNo, actually you are not. As it turns out, there is no such attribute (sorry my bad, screwed up). You have to use other techniques like creating a checkbox expression control somewhere. This has the additional benefit of being animatable. 😉
if(comp(“Comp 2”).layer(“Layer 3”).effect(“Switch”)(“Checkbox”) == true){90} else {100}Mylenium
[Pour Myl
-
Tyler Paul
December 19, 2006 at 1:21 pmUse a similar expression for the layer that you originally wanted as a control so that when the checkbox is on it’s opacity is at 100, when the switch is off the opacity switches to 0.
-
Dan Ebberts
December 19, 2006 at 2:15 pmThis should work just fine:
if(comp(“Comp 2”).layer(“Layer 3”).active) 90 else 100
Dan
-
Aled Rhys jones
December 19, 2006 at 2:21 pmFantastic, Thank you guys… I think Dan wins this battle!!
Aled
-
Dan Ebberts
December 19, 2006 at 2:26 pmHmmm… now that I think about it, this is probably better:
if(comp(“Comp 2”).layer(“Layer 3”).enabled) 90 else 100
Dan
-
Tyler Paul
December 19, 2006 at 2:36 pmFantastic, Thank you guys… I think Dan wins this battle!!
Of course! He’s Dan friggen Ebberts, expressionist extrodinaire. Mathematicians want to be him and their daughters wanna date him. They may be good but they’ll never be, the one, the only, Mr. Danny E.
-
Dan Ebberts
December 19, 2006 at 2:56 pmMmmm…mathematicians’ daughters. Don’t tell my wife. 🙂
Dan friggen Ebberts
-
Mylenium
December 19, 2006 at 6:27 pm[aled] “I think Dan wins this battle!!”
As is appropriate. The grande seigneur of code can outsmart us all. ;O)
Mylenium
[Pour Myl
Reply to this Discussion! Login or Sign Up