Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Tom Gomez on January 26, 2011 at 6:01 am

    Howdy folks,

    Got this expression going…

    Basically, an object changes to red (COLOR 4) if a certain variable is greater than 90 or if a different variable was less than 10. Otherwise, it’s blue (COLOR 1). No big deal. In the Fill/Color property of a rectangle shape, I have the following:

    >

    x=thisComp.layer(“GRAV percentage”).effect(“Numbers”)(“Value/Offset/Random Max”);
    y=thisComp.layer(“PROB percentage”).effect(“Numbers”)(“Value/Offset/Random Max”);

    if (x>90 || y<10){thisComp.layer(“COLOR 4”).content(“Fill 1”).color;

    }else{

    thisComp.layer(“COLOR 1”).content(“Fill 1”).color}

    >

    But here’s what I’m hoping to find… I’d like the object to become yet another color, green for example, if x and y are yet another combination. Specifically, if x<10 and y>90, I’d like the object to go to a THIRD color.

    Is there some sort of trumping “OR” statement out there?

    thanks,

    Tom

    ================================================
    YOU can help save TimeSpace. Join the Chronos Protectorate!

    https://www.95ers.com
    https://www.SpaceAceMedia.com

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

    January 26, 2011 at 8:08 am

    I think you just need to add an else if, like this:


    if (x>90 || y<10){
    thisComp.layer("COLOR 4").content("Fill 1").color
    }else if (x<10 && y>90){
    thisComp.layer("new_color_layer_here").content("Fill 1").color
    }else{
    thisComp.layer("COLOR 1").content("Fill 1").color
    }

    Dan

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