Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions animate layer position with angle control

  • animate layer position with angle control

    Posted by Moniek Van adrichem on May 30, 2014 at 6:43 pm

    Hi all,

    I’m animating 2d characters performing a dance. For this I figured it would be nice if I could use the angle control to animate the layer position (e.g. make the body look as if it turns by moving the arms & legs).

    Problem is that the angle control keeps counting up in the ..x degrees area. I tried to solve this as follows, but this didn’t do the job:


    slider = thisComp.layer("jurk rotation").effect("Angle Control")("Angle");

    if (slider>360)
    slider=slider%360

    else if (slider<90)
    linear(slider,0,90,0,15)

    else if (slider<180)
    linear(slider,90,180,15,0)

    else if (slider<270)
    linear(slider,180,270,0,15)

    else
    linear(slider,270,360,15,0)

    Can someone please help?

    Thanks a million!

    Moniek

    Moniek Van adrichem replied 11 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 30, 2014 at 7:16 pm

    I haven’t test this at all, but I think you’re looking for something like this:

    slider = thisComp.layer(“jurk rotation”).effect(“Angle Control”)(“Angle”);
    s = slider%180;
    if (s < 90)
    linear(s,0,90,0,15)
    else
    linear(s,90,180,15,0)

    Dan

  • Moniek Van adrichem

    May 30, 2014 at 9:26 pm

    That’s exactly what I was looking for, thanks so much!

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