Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions After Effects Expression deactivate layer if in comp

  • After Effects Expression deactivate layer if in comp

    Posted by Matthias Neumayer on September 5, 2014 at 9:15 am

    Hi guys,
    I am currently working on a huge animation with lots of comps. I have certain animations, that are used several times, but I don’t want to duplicate all the comps and I am trying to figure out a more elegant way to use those comps.

    Is there an expression, something like (” if layer in pre-comp1 is nested in comp2, then opacity=0″, or something like that), to deactivate certain layers if they are nested in a certain comp?

    Thanks in advance!

    Jim Lefevre replied 11 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Jim Lefevre

    September 10, 2014 at 11:53 am

    Matthias…

    I’m actually doing a similar thing right now (and am about to post a slightly different question) but I’m using an adjustment layer (called “EXPRESSION_DRIVER”) in my main comp (called “TOP_COMP”) which has an ‘effect control/effects checkbox’ within it.

    In my sub-comps I’m putting the opacity to have this expression…

    n =comp("TOP_COMP").layer("EXPRESSION_DRIVER").effect("TURN_LAYER_SET_A_ON")("Checkbox");

    if (n==1) {100} else {0}

    meaning when the checkbox “TURN_LAYER_SET_A_ON” in my TOP_COMP is ticked then all layers with that expression are on (100% opacity) if it’s unticked then it’s off (0% opacity) which means I can have easier control from the main comp to turn various layers on and off. ‘All’ you have to do is select the opacity from the sub-comp layer and copy it to all the animation layers that you want to turn off at that point and then set up different checkboxes to turn on and off the ones you want. If you want different sets then create a new checkbox expression with a different name (“TURN_LAYER_SET_B_ON” for instance).

    I suspect I might be getting your question wrong and also doing this the long way round too!!!

    http://www.jimlefevre.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy