Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sourceRectAtTime question

  • sourceRectAtTime question

    Posted by Jacob Roth on June 5, 2018 at 1:22 pm

    I’ve got a customizable lower third I’m working on, and I have two strokes surrounding the person’s title. I would like it so that the strokes paths lengthen and shorten based on the length of the title. I know that this is probably a sourceRectAtTime problem, but I’m not sure how to write the code. Any suggestions?

    Jacob Roth replied 8 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Kalleheikki Kannisto

    June 5, 2018 at 3:20 pm

    My answer with a question is: How far did you get?

    It would seem to me that there are several things that would need to change depending on text lengths. The length of the person’s name would additionally determine the overall length of the title plus lines, right?

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Jacob Roth

    June 5, 2018 at 3:44 pm

    I wouldn’t want the outer points to move inward for shorter names, but outward for longer names would be good.

    I have everything set up except the line’s lengths. I’ve tried getting the strokes just to change position with the title’s rectangle, but can’t seem to get it to work right.

    A little more info. I’ve included a gif so that you can see further complications. The lines have trim paths on them with a linear expression attached to a null.

  • Kalleheikki Kannisto

    June 5, 2018 at 4:54 pm

    Ok, so let’s try this.

    Here I’ve added a sourceRectAtTime() expression to change the value of the Trim Path start depending on the width of the text.

    This will alter your trim paths animation. Depending how you want it to look, you may need to add the same value to the end or use fractions to calculate the trim path end, meaning make it relative to the calculated start point rather than zero. (Tip: You can use the Linear expression to remap the range)

    12430_linewidth.aep.zip

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Jacob Roth

    June 5, 2018 at 6:57 pm

    This almost works, unless the title is too long and makes the value go over 100%.

    I think it would be better if I had two strokes around the title, with their x positions pegged to sourceRect. I’m not so worried that the length of the two strokes be identical to the top stroke.

    Thanks for your help. I didn’t know about gap in expression language.

  • Jacob Roth

    June 5, 2018 at 7:30 pm

    You’ve gotten me to my answer, and it has nothing to do with sourceRect.

    I just put the start point of the stroke on a slider, and I’ll slide the stroke into position. Not automatic, but close enough.

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