Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects After Effects write paragraph from bottom to top?

  • After Effects write paragraph from bottom to top?

  • Qendrim Spahija

    February 4, 2020 at 12:48 pm

    Hi there,

    I’m creating a template file in AE which I will use a lot (kind of lower thirds stuff).
    What I’m trying to do is within a text box when I write something I want it to start from bottom and then go up. I’ll attach some pictures of what I mean if I’m not clear.

    The problem is when I have a long title (5 words or above), it has to be written in two lines, but when I have a short title, it’s going to be only one line, and every time a title is short or long I have to adjust the position of the text box.

    I looked over the internet but can’t find a solution.

  • Chaz Chester

    February 5, 2020 at 1:34 pm

    I don’t think there’s a built-in function for that. If you’re using a consistent font size, I have a method that may help.

    Create a slider control determines how tall your text box is:
    s=thisComp.layer(“Text Layer Name”);
    s.sourceRectAtTime().height;

    Make another slider that divides that value by your font point to get the number of lines in the paragraph (in this case I used 13 for a 12.5 font point):
    Math.ceil((effect(“Height slider”)(“Slider”))/13)

    Make another slider to set the initial Y value of your text box: (no expression)

    Make another slider for the change in your Y value:
    effect(“Number of lines slider”)(“Slider”)*13

    Finally, set this expression for your text box’s position:
    temp = transform.position[0];
    [temp, thisComp.layer(“Text Layer Name”).effect(“Initial Y Value”)(“Slider”)-thisComp.layer(“Text Layer Name”).effect(“Change in Y Value”)(“Slider”)]

    This should make it so your text box moves up as you add lines, so the bottom of the text box stays in the same position.

  • Qendrim Spahija

    February 5, 2020 at 3:31 pm

    THANK YOU SO MUCH.

  • Justin Best

    August 9, 2020 at 12:08 am

    I was looking to do the same thing, but am new to the coding part of After Effects and could use a little help.
    I’m getting one error message on the text layer that reads:
    Error: Effect named “Initial Y Value” is missing or does not exist.

    How do I determine the Initial Y Value?

    Appreciate any help you have.

    Thanks!
    Justin

  • Chaz Chester

    August 9, 2020 at 1:21 am

    The Initial Y Value can be any number, it’s just where the text starts vertically. I have it referencing a slider control for easy access, so it’s looking for a slider control named “Initial Y Value”.

    You could add a Slider Control (Effect > Expression Controls > Slider Control) to the layer and right click on the effect name to rename it to “Initial Y Value”…

    …or here’s a much better version of all this that you can put right in the position expression for your text layer without having to deal with sliders (I made this way more complicated than I needed to because I was also pretty new to writing my own expressions at the time):

    [transform.position[0], transform.position[1]-(thisLayer.sourceRectAtTime().height)]

    Because the position property contains multiple values (x,y, and sometimes z), it’s what’s known as an “array.”
    The first value of an array is [0], the second is [1], the third is [2], and so on. You can tell something’s an array because it uses these square brackets: [ ]
    So we have an opening bracket, our first value, a comma, our second value, and a closing bracket.
    The first value is just the X value, and the second is the Y value minus the height of the layer.

  • Justin Best

    August 9, 2020 at 3:03 am

    Chaz,
    You are a genius!
    Worked perfectly. Thank you for the help and thorough explanation

Viewing 1 - 6 of 6 posts

Log in to reply.

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