This iExpression offers a simple possibility to align a text vertically (top/middle/bottom) also if the text changes over time.

This is useful, if you have keyframes on the source text or if you want to replace the text - for example using scripts - and don't want to realign it manually each time.

To use the iExpression, you need to specify a maximum number of lines and the expression appends empty lines to the top and bottom of the text until this maximum number of lines is reached. By this, your text has always the same numer of lines and hence the same height, no matter what size the actual content is. Depending on the options you set, the original text is placed in the middle (adding the same number of empty lines to top and bottom), at the top (adding all empty lines at the bottom), or at the bottom (adding all empty lines at the top).

  • Number of Lines

    The maximum number of lines for the text. (Or to how many lines the text should be extended with empty lines).

  • Alignment

    How the text should be aligned: center (higher): text in the middle, in case of doubt one more empty line at the bottom than at the top center (lower): text in the middle, in case of doubt one more empty line at the top than at the bottom top: text placed at the top, all empty lines below it bottom: text placed at the bottm, all empty lines above it

  • Empty Lines Content

    Leave empty normally. For testing purposes, but here any letter you like to visualize the empty lines inserted by the iExpression.

  • Longer Texts

    What to do when the actual text has more lines than specified in 'Number of Lines'

Vertical Align Text iExpression

by default applied to: 
source text
can be applied to: 
texts
iExpression Bundle: 

What are iExpressions?

iExpressions are After Effects expressions with an easy to use interface.

more infos

Comments

Hi, I just purchased this Source Text bundle via aescripts.
Any chance we could have the Center (center) option?
I know we only have Center (higher), and Center (Lower)
But wanted to requests that Center (center version). Thanks for your help :)

With an expression on the source text you cannot do that:
This text centering works by inserting empty lines to get the total number of lines you want to have.
So if you want to have 10 lines in total and your input text has 3 lines, the expression needs to add 7 empty lines in total 10 lines in total.
To place the text exactly in the center, this would mean we need 3.5 empty lines above and 3.5 empty lines below the text. But since we cannot add "half a line" to a text, we can either add 3 above and 4 below or vice versa.

If you want to place your text more accurately, you would need to add an expression to the layer's position.
However, until recently, you could not do this either, since expressions could not measure the size of a text layer.
In AE CC 2014.2 some new expressions features was added that could make this possible. I will see whether I can develop something for this in the next update.

Cheers
Mathias

Hi,

I'm looking at purchasing this script to help automate some after effects templates I'm building. I need my text to be bottom aligned but want to know if the expression remains 'live'? For example if I have 2 lines bottom aligned and I enter a carriage return and type a third line will the baseilne position of the new 3 lines be the same as the the 2 lines version?

Hi Rich,
yes, iExpressions are always "live".
Whenever you change your text, the iExpression automatically updates (as any other expression, too).

By the way, we are about to release iExpressions V2. It will be online in a few hours :-)
Still, if you purchase iExpressions V1 right now, V2 will be a free update for you.

Cheers
Mathias

That great timing! Thanks Mathias

AWESOME

Does this work with a paragraph text box in After Effects or does it only work when you put your own line breaks in? I can't get it to work with a paragraph text box. Instead of aligning the bottom line of text to the bottom of the text box, it aligns the first line of text to the bottom of the text box, therefore cutting off all lower lines of text. I am using it with compsfromspreadsheet.

Hi Amy,
it only works if your text has manually inserted line breaks. If you use paragraph text, the line breaks generated by Ae are not visible for expressions. Hence, the iExpression can only see a single line and therefore aligns the first line to the bottom.
Cheers,
Mathias

Thanks so much. That is what I was afraid of. I need paragraph text to keep really long disclaimers inside a text box without having to manually put line breaks in myself. Do you know of any way to get the bottom line of a paragraph text to snap to the bottom of the text box it is inside? I need the disclaimers to always stay right above a certain area in my comp.

Hi Amy,
I don't know any out of the box solution for this. Most likely you can write your own expression to achieve this. I recommend to search for sample expressions using the sourceRectAtTime function which allows to measure the size of a text layer. You probably want to apply some expression to the position of the text layer that first measures its size with sourceRectAtTime and then offsets the position accordingly to achieve the desired alignment.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.