Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions word by word text and centering

  • word by word text and centering

    Posted by Adam Greenberg on July 10, 2024 at 11:24 pm

    Hi everyone. I hope this is doable. I have a motion design that has words appearing one by one ( with a small scale up ) and the word moves over to let the next word come in. Then when all words are there, the entire phrase is centered. So I have 2 problems I havent solved yet.

    1. I would like to have the phrase be centered automatically. I suspect this is possible, but I am not sure. Plus, each word would have to be manually moved to respect the margin between each word.

    2. Even if there is a way to center these 3 words ( which must be on seperate layers due to their position ), the first word must be centered in the comp at the beginning. Any expression that may realign and center these 3 layers at the end, will change the 1st word`s position at the start.

    I have posted a project to iilustrate the goal, so if you edit the text, you will see the 2 problems immediately.

    Any help is much appreciated.

    Adam Greenberg replied 1 year, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Hector Vera

    July 11, 2024 at 7:27 pm

    Too bad I am unable to view the After Effects project since I do not have it currently installed. So some video clip showing the issue would have helped more.

    But I did found some solutions that may be able to help you with your issue. Here is a solution for each problems:

    1. To center the phrase automatically, you need to determine the horizontal spacing between each word. You can use the transform effect to move the entire phrase to the right by the total width of all the words divided by two, plus the width of the first word. That way, the phrase will be centered on the canvas. Then, you can split the text into separate layers and adjust the position of each layer accordingly.
    2. To center the entire phrase at the end, you can use the expression <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>value + [margin] / 2on each word’s position property. For example, if you want a margin of <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>200, you would use <b style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>value + 100 on the position properties of the layers you want to center. This should result in the entire phrase being centered at the end.

  • Adam Greenberg

    July 12, 2024 at 4:22 pm

    thanks Hector Vera, I haven’t tried it yet, but it would not center the first word. This is important. It is the only word we see at the beginning of the animation so it would be nice it if was centered. The problem is when we have 3 words ( which must be center justified – and on seperate layers ) I dont see how the composition will realign these layers centered while maintaining the first words initial position. I did however find a way to automatically center the 3 layers, but only if I have the justification centered, which wont work with the naimation I need to apply. I have a feeling the task is impossible.

  • Hector Vera

    July 17, 2024 at 2:18 pm

    So the first word is unable to center itself you say? If thats the case, try this: in order to center a text layer and keep the first word in its initial position, you can use a trick with an invisible text layer. Here is how it would work:

    1. Add a text layer to your comp and select it.
    2. Go to the “Animations” tab and click on the stopwatch icon to enable keyframes for this text layer.
    3. In the text layer properties, enable the “Character” option and set it to 2. (This will make the first word have a fixed width.)
    4. Create an additional invisible text layer below the first text layer.
    5. Select the first text layer and the additional invisible text layer.
    6. Right-click and choose “Make Nulls from Layer”.
    7. Create a 3D null object for the invisible text layer.
    8. In the 3D null object’s properties, set the position and rotation values to 0.
    9. Select both the 3D null object and the text layer and apply the “Align” effect.
    10. In the Align effect’s properties, set the center of the text layer and the invisible text layer to the 3D null object.

    With this setup, the 3D null object will stay in place while the first word will remain in its original position. And you are also to animate other properties on the text and invisible layer as needed to achieve the desired effect. Hope that this can solve the issue with the first word not being center as it should be. Good luck!

  • Adam Greenberg

    July 18, 2024 at 2:05 pm

    here is an animation. notice how the fist word is centered. then the whole phrase once all words are present, is centered. and each text layer has its own animation on scale and color and position. but the position is dependant on the final positioning of the whole phrase

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