FORUMS: list search recent posts

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>

Billy Sides
Is it possible to check if layer has an effect applied to it
on Apr 21, 2015 at 5:36:01 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


Return to posts index

Dan Ebberts
Re: Is it possible to check if layer has an effect applied to it
on Apr 21, 2015 at 5:55:16 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



Return to posts index

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