Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Is there an “OR” expression?

  • Is there an “OR” expression?

    Posted by Dmitry Yershov on February 17, 2014 at 8:00 pm

    Hi everyone,

    I’m not good with expressions, can anybody tell me if this is possible:

    Basically, I have 5 Expression Controls checkboxes and 1 Layer with a mask.

    I want to change it’s Mask Expansion value from 32 to 0 if either one of those checkboxes is checked.

    Is it possible?

    Todd Kopriva replied 12 years, 2 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 17, 2014 at 9:09 pm

    You use || for OR, like this:

    if (effect(“Checkbox Control 1”)(“Checkbox”).value ||
    effect(“Checkbox Control 2”)(“Checkbox”).value ||
    effect(“Checkbox Control 3”)(“Checkbox”).value ||
    effect(“Checkbox Control 4”)(“Checkbox”).value ||
    effect(“Checkbox Control 5”)(“Checkbox”).value)
    32
    else
    0

    Dan

  • Dmitry Yershov

    February 17, 2014 at 10:58 pm

    Works perfectly! Thanks a lot Dan!

  • Todd Kopriva

    February 18, 2014 at 10:41 pm

    Keep in mind that the expression language is essentially an extended form of JavaScript, so the answer that Dan gave you could be found in a JavaScript reference, like this:
    https://www.w3schools.com/js/js_comparisons.asp

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    After Effects quality engineering
    After Effects team blog
    ———————————————————————————————————

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