ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

sourceRectAtTime expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Asher Burridge
sourceRectAtTime expression
on Feb 15, 2019 at 12:02:10 pm

Hi,

I’m trying to get a sourceRectAtTime expression to work out the longest text box length and use that to create a box behind.
However, no matter how I change the s= value, I can’t seem to work it out.

Any help would be greatly appreciated!
The current expression below:

s = thisComp.layer("TOP LINE TEXT LONGER STILLER") = if((thisComp.layer("TOP LINE TEXT LONGER STILLER")>thisComp.layer("TEXT 2”)) else thisComp.layer("TEXT 2”);

x = s.sourceRectAtTime(time-s.inPoint,true).width;

y = height = 104;

[x , y]

Thanks!


Return to posts index

Andrei Popa
Re: sourceRectAtTime expression
on Feb 15, 2019 at 2:33:56 pm

Maybe something like this
width1 = thisComp.layer("TOP LINE TEXT LONGER STILLER").sourceRectAtTime(time,true).width;
width2 = thisComp.layer("TEXT 2").sourceRectAtTime(time,true).width;
x = Math.max(width1, width2);
y = 104;
[x , y]


Andrei
My Envato portfolio.


Return to posts index

Asher Burridge
Re: sourceRectAtTime expression
on Feb 15, 2019 at 3:50:29 pm

Thank you so much Andrei. Worked like a charm!


Return to posts index

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