Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Problem with a simple expression

  • Problem with a simple expression

    Posted by Philippe Lessard on March 24, 2016 at 4:24 pm

    Hi,

    I cant figure out what wrong with this expression:

    opacity=thisComp.layer(“soundhomme”).effect(“Sound Keys”)(“Output 1”);
    if (opacity <; 50){ (100); }else{ (0) ; } Like you see I use the soundkey plugin output that return values between 0-100 from audio analyse. I want the value to be 0 or 100, so rounded values.I pickwip the output value of soundkey from the opacity of the layer I want to animate, than add the "opacity=" at the beginning of the expression, and the " if (opacity < 50){(100);}else{ (0) ; } " at the end. Also it return no error! Thanks opacity=thisComp.layer("soundhomme").effect("Sound Keys")("Output 1");
    if (opacity &lt; 50){
    (100);
    }else{ (0) ; }

    Philippe Lessard replied 10 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 24, 2016 at 5:46 pm

    You shouldn’t use opacity as a variable name. I’d do it like this:

    sk=thisComp.layer(“soundhomme”).effect(“Sound Keys”)(“Output 1”);
    if (sk < 50) 100 else 0

    Dan

  • Philippe Lessard

    March 24, 2016 at 8:42 pm

    Hi Dan,

    Yep that was good idea…

    Thanks

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