ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

sourceRectAtTime question

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacob Roth
sourceRectAtTime question
on Jun 5, 2018 at 1:22:04 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?



Return to posts index

Kalleheikki Kannisto
Re: sourceRectAtTime question
on Jun 5, 2018 at 3:20:24 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


Return to posts index

Jacob Roth
Re: sourceRectAtTime question
on Jun 5, 2018 at 3:44:48 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.



Return to posts index


Kalleheikki Kannisto
Re: sourceRectAtTime question
on Jun 5, 2018 at 4:54:58 pm
Last Edited By Kalleheikki Kannisto on Jun 5, 2018 at 5:02:36 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


Return to posts index

Jacob Roth
Re: sourceRectAtTime question
on Jun 5, 2018 at 6:57:33 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.


Return to posts index

Jacob Roth
Re: sourceRectAtTime question
on Jun 5, 2018 at 7:30:46 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]