Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions How do I keep the number of dashes in a stroke constant?

  • How do I keep the number of dashes in a stroke constant?

  • Robert Røbke

    December 20, 2021 at 4:22 pm


    i need an expression to keep the number of dashes constant while animating one point of a path, so that the “growth” is noticeable. The distance between the individual dashes need to move with the path. Hope you get what i mean..

    Thanks for your help! 🤗

  • Kevin Camp

    December 23, 2021 at 11:17 pm

    Assuming you are using a shape layer and a straight path with two points, you could try this on the ‘dash’ property:

    n = 10 ; // number of dashes
    shp = content("Shape 1").content("Path 1").path ;
    p1 = shp.points(time)[0] ;
    p2 = shp.points(time)[1] ;
    d = length( p1, p2 )
    d / n / 2

    If its curved, the math would be much more difficult.

    If you are OK with dots on a line versus dashes, you can use the Audio Waveform effect on a layer… Set the Display Options to ‘Digital’, the Audio Samples to the number of dots you want, the Thickness and colors as needed. The create a mask on that layer (curved or straight) and, in the Audio Waveform settings, set the Path property to that mask. Then you can animate the mask as needed and the line of dots will follow it and maintain a consistent number of dots.

  • Robert Røbke

    January 7, 2022 at 12:13 pm


    sorry for the late reply, thanks for your help(!!), this is exactly what i was looking for! 🤩 I love you. 😆

Viewing 1 - 3 of 3 posts

Log in to reply.

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