Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position text box relative to bottom of previous text box

  • Position text box relative to bottom of previous text box

    Posted by Ali Brown on February 10, 2020 at 11:59 pm

    I need to position a text layer (inside an auto-scaling shape box) relative to the text layer above it.

    My goal is to produce an essential graphics file with dynamic text boxes vertically positioned.

    i.e.

    HEADING
    HEADING SECOND LINE

    Paragraph starts here, relative to heading above.

    Second paragraph starts here, relative to paragraph above.

    I’ve managed to sort of get this working through parenting and anchor offset.

    However when I type into the the child element (say the first or second paragraph above), the alignment offset begins to ‘creep’. I think this is because the auto-scaling text box effect relies on the anchors being centred.

    I’ve trawled the forums and tried a heap of expressions to do this but can’t seem to work it out!

    **UPDATE**

    I worked it out! This places the following element at 50px below the Text1 layer.

    a = thisComp.layer(“Text1”).transform.position[0];
    b = thisComp.layer(“Text1”).transform.position[1];
    c = thisComp.layer(“Text1”).sourceRectAtTime();

    Top = c.top;
    Width = c.width;
    Left= c.left;
    Height = c.height;

    x=a;
    y=b+Height+50;

    [x,y];

    Tomas Bumbulevičius replied 4 years, 6 months ago 3 Members · 2 Replies
  • 2 Replies
  • Tom de Jongh

    January 24, 2022 at 2:46 pm

    Hi, thanks for the update. This is almost working for me. But not quite. Hope someone will come to the rescue!

    It works great for single line texts, but if you add another line, the position of that text layer won’t change. You’ll end up with screwed layout.

    Is there anyone who’s got an answer how to fix this? Maybe add the total height of the text layer above.. I don’t know how (yet).

     

  • Tomas Bumbulevičius

    January 24, 2022 at 6:12 pm

    Hey Tom, in the past I made a video about “these type” of problems and you could get more sense about it here: https://youtu.be/8CkpIfGoZI8

    In short – you need to modify anchorpoint of text layer, that it “stays” in the place you want it to be. in this case, I case it should grow from the bottom to the top – thus you need to set expression for text to stick based on its sourceRect height.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

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