Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions problem with multiple if else statesment

  • problem with multiple if else statesment

    Posted by Constanti Dinu on February 25, 2025 at 11:37 am

    hi, im trying to do something but im halway there and dont know why is not working.

    i have 3 text layers “titlu 1”, “titlu 2” and “titlu 3”.

    titlu 1 is visible, the rest ar turned off from the eye icon visibility.

    what ive managed is if i turn on visibility on “titlu 2”, “titlu 1” changes its position.

    if (thisComp.layer(“titlu 2”).active)

    value + [0,-50]

    else

    value

    i want turn on “titlu 3” also and move the position of “titlu 1” again

    if (thisComp.layer(“titlu 2”).active) value + [0,-50]

    else

    if (thisComp.layer(“titlu 3”).active) value + [100,-200]

    else value

    its not working and i dont know why, any suggestions?

    Brie Clayton replied 4 weeks ago 3 Members · 4 Replies
  • 4 Replies
  • Constanti Dinu

    February 25, 2025 at 11:51 am

    im guessing should be something like this but still not working

    if (thisComp.layer(“titlu 2”).active) value + [0,-50]

    else

    if ((thisComp.layer(“titlu 2”).active)&&(thisComp.layer(“titlu 3”).active)) value + [100,-200]

    else value

  • Dan Ebberts

    February 25, 2025 at 1:07 pm

    Maybe like this:

    val = value;
    if (thisComp.layer("titlu 2").active) val += [0,-50];
    if (thisComp.layer("titlu 3").active) val += [100,-200];
    val
  • Constanti Dinu

    February 25, 2025 at 3:40 pm

    works perfect, thank you very much. always helpful, mr Ebberts 🙂

  • Brie Clayton

    February 25, 2025 at 6:59 pm

    Thank you for solving this one, Dan!

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