Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions If else expression with references

  • If else expression with references

    Posted by Brice Munn on February 11, 2020 at 1:45 pm

    Hi,

    Forgive the shoddy syntax, I’m no expert with expressions. I’m struggling to make this work. It’s the “if” part that’s failing.

    Basically I’d like to use “t” in a calculation, and I’d like “t” to mean “1” if “q” is less than or equal to “g”, otherwise I’d like “t” to mean “0”.

    The error AE returns is on line 8 (starting if…) “Syntax Error: Unexpected Token: <=”

    Hope that makes sense!

    m=effect("Opacity Animation Multiplier")("Slider")/100;
    d=thisComp.layer("Global Control").effect("Opacity Deviation")("Slider");
    s=thisComp.layer("Global Control").effect("Opacity Speed")("Slider");
    q=1;
    g=thisComp.layer("Global Control").effect("Number of digits")("Slider");
    t=
    {
    if(q&lt;=g){1}else{0}
    };

    ((wiggle(s,d)*0.5)+10)*m*t;

    Dan Ebberts
    replied 6 years, 2 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 11, 2020 at 8:16 pm

    try changing the section that defines t to this:

    t = (q <= g) ? 1 : 0;

    Dan

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