Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions if/else Checkbox to switch between color controls

  • if/else Checkbox to switch between color controls

    Posted by Jano Sempere on September 3, 2019 at 8:03 am

    I have path layers and need to switch between two colors for BG white and BG black.
    Want to link to checkbox to take ease control but can’t find right expression.

    Sorry for bad embedings, don’t know how to.
    Thanks.

    ch = thisComp.layer("color Control").effect("Logo versión")("Checkbox");
    c1= thisComp.layer("color Control").effect("Color Control")("Color");
    c2=thisComp.layer("color Control").effect("Color Control 2")("Color");
    if (ch== 0) [c1]
    else [c2]

    Motiongrapher at cinestorm.es

    Jano Sempere replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 3, 2019 at 11:43 am

    For one thing, you need to remove the square brackets in the last two lines, like this:

    if (ch== 0) c1
    else c2

    or even better like this:

    ch ? c2 : c1

    but in your question you mention “ease” which makes me think you’re after something else…

    Dan

  • Jano Sempere

    September 3, 2019 at 2:31 pm

    My mistake, I’ve mean “easy way to do”

    Worked perfectly, many thanks Dan.

    Motiongrapher at cinestorm.es

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