Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Textbox, align text vertically to bottom

  • Textbox, align text vertically to bottom

    Posted by Bas V breugel on August 16, 2019 at 2:12 pm

    I am searching the forum for a way to align texts vertically to the bottom inside a text box. Read some sourceRectAtTime expressions, but no succes on adding this to my text layer. This expression has to be added to the Anchorpoint right?

    Ideally adjusting the box with the mouse cursor does not influence the expression. For example for the box to be bigger.

    Adam Greenberg replied 4 years, 7 months ago 4 Members · 4 Replies
  • 4 Replies
  • Andrei Popa

    August 29, 2019 at 8:16 am

    Add this to the anchor point. I hope this is what you are looking for

    var left = sourceRectAtTime(time,false).left;
    var top = sourceRectAtTime(time,false).top;
    var myWidth = sourceRectAtTime(time,false).width;
    var myHeight = sourceRectAtTime(time,false).height;
    var x = left;
    var y = top + myHeight;
    [x,y]

    Andrei
    My Envato portfolio.

  • Bill Hall

    September 20, 2021 at 2:46 pm

    The expression above didn’t work for me the one I got from Reddit worked. I pasted the expression below and the link to the post in case the formatting is messed up when I pasted

    // get size of layer. Returns obj with { left, top, width, height }
    var b = sourceRectAtTime(time,true);

    // correct for scaled layers.
    b.left *= scale[0]/100;
    b.top *= scale[1]/100;
    b.width *= scale[0]/100;
    b.height *= scale[1]/100;

    // stick anchor at horizontal center, vertical bottom.
    [b.left + b.width/2 , b.top + b.height]

    // You could also use this to lock at bottom left:
    // [b.left , b.top + b.height]

    https://www.reddit.com/r/AfterEffects/comments/d6k4zz/have_text_build_from_the_bottom_up/

  • Bill Hall

    September 20, 2021 at 2:46 pm

    I might be doing something wrong or it may have changed in AE but this didn’t work for me

  • Adam Greenberg

    September 20, 2021 at 4:20 pm

    is your anchor point set at the bottom ?

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