Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression help: If X = 1 then do the following…

  • Expression help: If X = 1 then do the following…

    Posted by Aharon Rabinowitz on December 6, 2006 at 10:42 pm

    Hey there-

    I am working on a tutorial on expression controls but the control called Checkbox Control is hard to demonstrate practically. It uses a binary value system of off or on, which is really 0 or 1. Now there are some effects and propertues that use this sytem (such as the property in the fractal noise effect called invert), but animating that propery isn’t a common thing for people to do.

    Since the system uses 0 or 1, I was thinking of demonstrating an expression like – If X = 0 then do this, if X = 1 do this.

    So how do I write an If then Statement?

    To set up x properly, I know that I need to write this

    x = thisComp.layer(“Null 2”).effect(“Checkbox Control”)(“Checkbox”);

    after that, I’m lost. I can figure out how to write the part about what should happen, I just don;t know how to write if X = 0 do this, if X = 1 do that.

    Thanks.

    Aharon

    —————————————-
    Aharon Rabinowitz
    aharon(AT)yahoo(DOT)com
    http://www.allbetsareoff.com
    —————————————-
    Creative Cow Master Series DVD
    particleIllusion Fusion Volume 1
    available @ http://www.pIllusionFusion.com

    Aharon Rabinowitz replied 19 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 6, 2006 at 11:14 pm

    Here’s a simple checkbox for Opacity expression that should get you started:

    x = thisComp.layer(“Null 2”).effect(“Checkbox Control”)(“Checkbox”);
    if (x == 1){
    100;
    }else{
    0;
    }

    Dan

  • Aharon Rabinowitz

    December 6, 2006 at 11:25 pm

    Thanks! Very Helpful.

    —————————————-
    Aharon Rabinowitz
    aharon(AT)yahoo(DOT)com
    http://www.allbetsareoff.com
    —————————————-
    Creative Cow Master Series DVD
    particleIllusion Fusion Volume 1
    available @ http://www.pIllusionFusion.com

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