Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate a shape layer's stroke based on the duration's property of a composition

  • Animate a shape layer's stroke based on the duration's property of a composition

    Posted by Nick Mara on September 10, 2020 at 12:06 am

    I’m trying to find a way to animate the stroke of a shape layer based on the time duration’s property of a custom composition.

    Probably there’s already a script out there but I can’t find it so I’m wondering if there’s a simple way to do it maybe via expressions.

    I’d like to:

    1 – Import any kind of footage of any length into After Effects

    2 – Create a new composition with the selected video

    3 – Inside of the composition I would create a Shape Layer, for example an empty Rectangle with the stroke activated, which automatically connects the start/end of the stroke, using trim paths, to the duration of the composition itself.

    In this way I would have an animated overlay frame, which in this case it would be the stroke of an empty rectangle, on top of any custom video from the start to the end of any footage.

    Imagine it like an automatic loading bar/countdown which works for any footage of random length.

    Maybe I’m thinking it wrong but I would really appreciate if someone of you could help me.

    Please tell me if the question is not clear, I would try to explain it better.

    Thanks in advance Grinning

    Chris Jeffries replied 5 years, 8 months ago 5 Members · 4 Replies
  • 4 Replies
  • Thomas Luca

    September 10, 2020 at 12:44 am

    I cannot think of anything of a solution for your problem. But, I think I know someone who can, VideoCoPilot.com

  • Dan Ebberts

    September 10, 2020 at 12:44 am

    I think an expression like this for the End property of your Trim Paths would work:

    time*100/thisComp.duration

    Dan

  • Walter Soyka

    September 10, 2020 at 12:55 am

    On your Trim Paths End property, you could use something like:

    <pre class=””>linear(time, 0, thisComp.duration, 0, 100);

    Here’s a sample project [link] that shows how it works. For bonus points, this project lays out the progress bar proportionately in any size comp.

  • Chris Jeffries

    September 10, 2020 at 1:29 am

    This sounds like a possible batch job… You may be interested in the excellent CompsFromSpreadsheet script, which I’ve used extensively and recommend:

    https://aescripts.com/compsfromspreadsheet

    It supports automated importing, variable comp length, and could be combined with one of the other solutions here via the template you’ll need to set up.

    Do let us know what ends up working for you?

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