Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is it possible to check if layer has an effect applied to it

  • Is it possible to check if layer has an effect applied to it

    Posted by Billy Sides on April 21, 2015 at 5:36 pm

    I need to check if a layer below a layer has an effect applied to it.
    The problem I’m running into is if the effect doesn’t exist AE throws an error and disables the expression. Is there a way around this? I’ve tried other variations with little luck.

    My goal is to check if the layer below has a checkbox effect applied to it, then to check the value of the checkbox.

    if(checkbox exists && checkbox == true){
    50;
    }else{
    0;
    }

    if(thisComp.layer(index+1).effect("My Checkbox")("Checkbox")!= undefined && thisComp.layer(index+1).effect("My Checkbox")("Checkbox")==true){
    50;
    }else{
    0;
    }

    -bsides

    Dan Ebberts
    replied 11 years ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    April 21, 2015 at 5:55 pm

    I think I’d do it this way:


    try{
    if (thisComp.layer(index+1).effect("My Checkbox")("Checkbox").value == 1) 50 else 0;
    }catch (err){
    0;
    }

    Dan

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