Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Blink slider to control the Y position of another layer.

  • Blink slider to control the Y position of another layer.

    Posted by Roberto Mata on January 22, 2015 at 1:17 pm

    Hello,

    I’m new to after effects an have some trouble solving this expression I need.
    I’m rigging the head of a 2D character. I have set a slider to control the blinks of its eyes.
    The slider has three pairs of blink associated with if/else.

    From 0 to 10: eyes closed.
    From 11 to 20: sibylline eyes.
    From 21 to 30: neutral eyes.
    Frpm 31 to 40: wide open eyes.

    I’ve used this kind of expression:

    a=thisComp.layer(“HEAD_CTRL”).effect(“BLINK”)(“Slider”);
    if((a>30)&&(a<=40)) 100 else 0

    NOW, I want the eyebrows to change their Y position with just one blink mode, the wide open eyes. So I wrote down the Y value for both positions and made an expression for Y position like this:

    a=thisComp.layer(“HEAD_CTRL”).effect(“BLINK”)(“Slider”);
    if((a>30)&&(a<=40)) 524 else 528

    And it worked, but then I needed to parent the eyebrows to the HEAD_CTRL, and when I did OBVIOUSLY the eye brows comp went crazy. I figured out it was because I set some fixed values for Y that wouldn’t work if I changed the HEAD_CTRL position.

    So I need some variation of that expression for any position of the HEAD_CTRL.
    I want the eyebrows, to be in some Y position when the blink slide is set to “SURPRISE EYES” and Y position +4 with any other.

    Something like this, but in proper java language:

    a=thisComp.layer(“HEAD_CTRL”).effect(“BLINK”)(“Slider”);
    if((a>30)&&(a<=40)) Y position else Y position+4

    Thanks.

    Roberto Mata replied 11 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 22, 2015 at 2:57 pm

    Try this:

    if((a>30)&&(a<=40)) value else value+4

    Dan

  • Roberto Mata

    January 22, 2015 at 3:18 pm

    Worked great!

    Thanks, Dan. And sorry for my novice question.

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