ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

If else expression with references

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brice Munn
If else expression with references
on Feb 11, 2020 at 1:45:34 pm


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");
g=thisComp.layer("Global Control").effect("Number of digits")("Slider");


Return to posts index

Dan Ebberts
Re: If else expression with references
on Feb 11, 2020 at 8:16:48 pm

try changing the section that defines t to this:

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved