Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Having Trim Paths Translate to rotation

  • Having Trim Paths Translate to rotation

    Posted by Toby Garcia on February 9, 2016 at 7:57 pm

    Hi there,

    Long time reader but first time poster. I have been working on an After Effects template that has two line paths with a stroke. They are arranged to form and function like the hands of a clock. I also have a second shape layer with a circle and a trim paths which is acting as an “arc” between the two hands based on the difference of their angles. I was able to accomplish it relatively simple and it works with negative rotation (EX1) I like the way that when the “Hands” pass each other the arc “flips” directions. This desired behavior however breaks down when either hand reaches a full revolution. I have tried using the offset function to make one hand a kind of “live” 0. And having the other hand as the difference between the the hands but still to no avail. I had even gotten to some IF statements to try to swap the “live” 0 as the hands passed each other but just ended up confusing my self. I feel like I’m almost there but am missing something crucial. Do you guys have any ideas?

    //Trim Paths Start
    a=thisComp.layer("Control").effect("[A]Rotation")("Angle")%360;
    b=thisComp.layer("Control").effect("[B]Rotation")("Angle")%360;
    linear(a,0,360,0,100)
    //Trim Paths End
    a=thisComp.layer("Control").effect("[A]Rotation")("Angle")%360;
    b=thisComp.layer("Control").effect("[B]Rotation")("Angle")%360;
    linear(b,0,360,0,100)

    Kalleheikki Kannisto replied 10 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kalleheikki Kannisto

    February 11, 2016 at 6:22 pm

    The problem lies in that “0” point is the origin point for the path, so the trim paths ends there no matter what.

    My guess is that it would work if you linked the rotation of the circle to the rotation of one of the arms so that the zero point would stick to it, and amend your expressions accordingly.

  • Kalleheikki Kannisto

    February 12, 2016 at 11:37 am

    You will likely have two other situations to contend with:

    What happens when BA+360

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