Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Trim Paths on shape to match size of text

  • Trim Paths on shape to match size of text

    Posted by Andy Hilbourne on June 20, 2017 at 7:58 am

    Hi there,

    I use a template to have questions appear on screen regularly, what happens is a line grows from the centre using a trim paths and then the text rises up from behind it.

    What I want to do is have the trim paths % match the size of the text box.

    So if say the question is “what” I want the line to stop growing at the width of the word, if the question is “what is a development” I want the line to go across all the words.

    Any suggestions I’ve fiddled with pistol-whipping but found no solution

    Thanks

    Philip Neves replied 9 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Philip Neves

    June 20, 2017 at 1:46 pm

    Here’s one possible solution:

    1. Make your line shape layer the width of the comp (because I don’t know how to get the length of a line).
    2. Apply this expression to the line’s scale:


    s=thisComp.layer("Text");
    pad = 0;
    line = s.sourceRectAtTime(time,true).width+pad;
    q = 100*(line/thisComp.width);
    [q,100]

    3. Change the “s” variable to target your text layer.
    4. Animate Trim Paths Start and End properties in whatever way you prefer.

    You can change the pad variable in that expression to add some extra length to each side of the line.

    Does that work?

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