Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sourceRectAtTime expression

  • sourceRectAtTime expression

    Posted by Asher Burridge on February 15, 2019 at 12:02 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!

    Asher Burridge replied 7 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    February 15, 2019 at 2:33 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.

  • Asher Burridge

    February 15, 2019 at 3:50 pm

    Thank you so much Andrei. Worked like a charm!

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