Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Tutorial rolling circles onto the screen

  • Tutorial rolling circles onto the screen

    Posted by Geoff Vane on September 2, 2022 at 12:08 pm

    Paste the code onto the position expression of a circle you made.

    Use the rotation of the circle to roll the circle onto the screen.

    // The radius is half the bounding box size

    r = (thisLayer.sourceRectAtTime().width)/2;

    // Scale compensation
    s = thisLayer.transform.scale[0];
    compensation = (s-100)*.01;

    // compensated radius

    cr = r + compensation * r;

    // Number of pixels to roll, is circumference/360

    circumference = 2*Math.PI*cr;

    [value[0]+(circumference/360)*thisLayer.transform.rotation,value[1]]

    Geoff Vane replied 4 years ago 2 Members · 2 Replies
  • 2 Replies
  • Vincenzo Imbimbo

    September 2, 2022 at 12:20 pm

    This is freaking amazing!! Thank you so much, this will save me tons of time.

  • Geoff Vane

    September 2, 2022 at 9:32 pm

    Thanks. You’re welcome. If you have any script requests, feel free to contact me.

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