Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slider Control to adjust position

  • Slider Control to adjust position

    Posted by Benjamin Taylor-day on April 5, 2013 at 5:06 pm

    Hi, Im very new to AE, but im currently learning expression controls.

    Im working on an animation on a character where i want the ear move between 2 points, A = 1088, 766 and B = 980, 952, rather than moving the ears manually each time i would like to use a slider control.

    I’ve tried pick whipping “position” to the slider but that just moves the ear to 100,100 and when i move the slider it moves the ear up and down equally 101,101 – 102,102 – 103,103 etc etc)

    Is their a way to create a pre-defined path for the object to follow using the slider?

    I hope ive made sense. All new and complicated to me.

    Thanks,

    Ben

    Dan Ebberts replied 13 years, 4 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    April 5, 2013 at 5:53 pm

    This will move the layer between A and B as the slider goes from 0 to 100:

    s = effect(“Slider Control”)(“Slider”);
    A = [1088,766];
    B = [980,952];
    linear(s,0,100,A,B)

    Dan

  • Benjamin Taylor-day

    April 5, 2013 at 6:10 pm

    Thanks Dan!

    Ive put that into the expression box for “position” on the ear layer? Is that right as i get an “expression disabled error?

    Would you be able to explain what that code “means”, so i can try and get my head around expressions.

    Thank you again 🙂

  • Benjamin Taylor-day

    April 5, 2013 at 6:12 pm

    Oh wait, ive sorted it! I just had to pick whip the “effect(“Slider Control”)(“Slider”);” bit!

  • Benjamin Taylor-day

    April 7, 2013 at 1:55 pm

    Would i have to do anything different if i wanted this movement controlled by the angle control so position A = 0 and position B = 360?

    Ive tried this code but it doesnt work:

    s = thisComp.layer(“Control”).effect(“Ears”)(“Angle”);
    A = [1088,766];
    B = [980,952];
    linear(s,0,360,A,B);

  • Dan Ebberts

    April 7, 2013 at 4:30 pm

    It works the way I would expect it to. What does is it doing for you? Are you getting an error message?

    Dan

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