Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions long expression for if/then/else

  • long expression for if/then/else

    Posted by Constanti Dinu on January 15, 2020 at 11:28 am

    hello guys, i need to find out a sollution for an expression.
    i’m using a checkbox that switches colours based on selection.

    logically it will be if a=0 then b else c.

    a should be
    (comp(“countries”).layer(“color scheme”).effect(“activate”)(“Checkbox”) == 0)

    b should be
    try{NUME = thisComp.layer(index).name.split(” “)[0];
    x = Math.floor(comp(“countries”).layer(NUME).effect(“color scheme”)(“Slider”));
    comp(“countries”).layer(“color scheme”).effect(“land ” + x)(“Color”);
    } catch(err) {
    x = [1,1,1,1]
    }

    c should be
    comp(“countries”).layer(thisLayer.name).effect(“country colour”)(“Color”)

    i don’t know how to include these expressions into if then else text.
    please help

    Andrei Popa replied 6 years, 4 months ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    January 15, 2020 at 2:21 pm

    I think this should work.

    if (comp("countries").layer("color scheme").effect("activate")("Checkbox") == 0){
    try{
    NUME = thisLayer.name.split(" ")[0];
    x = Math.floor(comp("countries").layer(NUME).effect("color scheme")("Slider"));
    comp("countries").layer("color scheme").effect("land " + x)("Color");
    } catch(err) {
    x = [1,1,1,1]
    }
    }else{
    comp("countries").layer(thisLayer.name).effect("country colour")("Color")
    }

    Andrei
    My Envato portfolio.

  • Constanti Dinu

    January 15, 2020 at 2:40 pm

    worked like a charm! you’re a genius ☺

    multumesc mult

  • Andrei Popa

    January 15, 2020 at 4:19 pm

    Cu placere!
    Spor la animat!

    Andrei
    My Envato portfolio.

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