Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating arrows using trim paths

  • Animating arrows using trim paths

    Posted by Alan Flood on November 4, 2011 at 12:12 am

    Hi guys,

    I’ve recently been commissioned to create 40 animations illustrating various Physics related concepts – things like waves and electricity etc. Anyway, I’ve found myself having to create endless amounts of arrows and, since I took the approach of animating the arrows in the beginning I’m kind of stuck animating them now and boy does it take a lot of time. I’ve managed to keep my layer stack relatively clean by storing the arrows in a single shape layer and re-using them by setting hold keyframes on the individual content groups transform properties. Clear labeling allows me to quickly find what I want to animate but then, setting three sets of keyframes for each arrow is alitte bit time comsuming and it’s bothersome when I know there’s likely a way to automate it so that I will only have to set two keyframes on one property instead of 6 keyframes on three properties.

    Each arrow is comprised of 3 lines – the main body of the arrow and two smaller lines to represent the arrow head. I’m using Trim Paths to animate the arrows (keyframing a total of 3 Trim Paths ‘end’ properties [0% -> 100%]) and what i’d like to learn, if any of you have the time, is how to …..

    automate the trimming of the two smaller ‘head’ lines by applying an expression to the ‘end’ property of the Trim Paths function. I’d like these lines to trim automatically – beginning where the final keyframe of the Trim Paths ‘end’ property of the main body line has been set.

    I also need to be able to define a length of time over which the automated Trim will take place. Begin able to control the animation of these arrows with two keyframes will save me a LOT of time and I’d really, really appreciate any help any of you could give me. Thanks for reading 🙂

    Liran Tabib replied 8 years, 10 months ago 4 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 4, 2011 at 3:28 am

    Assuming that you’ve named the main stroke “main body line”, you should be able to use something like this:


    dur = .5;
    p =content("main body line").content("Trim Paths 1").end;
    if (p.numKeys > 0){
    tStart = p.key(p.numKeys).time;
    linear(time,tStart,tStart+dur,0,100)
    }else
    value

    Variable dur sets the duration of the write-on of the arrow head lines. You might want to tie this to a global slider somewhere.

    Dan

  • Alan Flood

    November 4, 2011 at 6:48 am

    I’m grinning from ear to ear here Dan. You rock! Thank you so much – this is a gem 🙂

  • Adrian Thompson

    February 17, 2015 at 11:21 pm

    I know this post is very old, but I wanted to share in case it helps other people searching like I have.

    We’ve developed this new After Effects script, Easy Arrows, which allows you to attach an auto-orienting arrow (or any shape) to an animated stroke, with the click of a button. https://modio.tv/downloads/easy-arrows/

    Hope you find it useful. 🙂

  • Liran Tabib

    December 18, 2015 at 9:33 am

    4 years after and you have an Arrow preset that makes this automatically:
    https://www.vdodna.com/products/arrow-preset/

  • Liran Tabib

    July 4, 2017 at 6:14 pm

    Here Is a new ArrowHead Tool I’ve developed in the last Year, and you can create with it any Arrows that you wish, change the Head/Tail as you wish, and it’s really easy to use. I hope you enjoy it and that it will save you some time and hassle creating arrows.

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