• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change position of each line of text with expression

Explorer ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

I'm working with a client that has updated it's brand guidelines and for social content and ads with shorter text blocks they are offsetting the text - on each row in a text block individually - on the x axle.

Row 1 is - 50 px from the centre, row 2 is + 55 px, row 3 is - 85 px and so on.

I have until now just split the text into one layer per row and moved them to a nice layout.

It works but is a pain in the a** when you have to do changes or translation.

So is there a way - with expressions and/or text animatior/range selector - to keep the multi line text block "intact/live" without splitting it into layers but control the position of each row?

Need to be able to do line breaks and scale the text box from shot to shot.

Would be golden if I could attatch the position of each row to a slider control. 

TOPICS
Expressions

Views

861

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , May 29, 2023 May 29, 2023

1st text layer for line 1 only

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 1;
if (txt.length >= n)
txt[n-1]
else
""

for 2nd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 2;
if (txt.length >= n)
txt[n-1]
else
""

 for 3rd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 3;
if (txt.length >= n)
txt[n-1]
else
""

Votes

Translate

Translate
Community Expert ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

I suggest you start working with the Extended Graphics Panel and use three text layers. If your content can be edited in Premiere Pro, you can create a MOGRT that allows you to do all of the text editing in Premiere Pro's Graphics workspace, saving you a lot of time. 

 

I have created a single MOGRT that contains a dropdown menu to select all social media frame sizes, repositions each layer, adjusts the color of the text based on the background footage, lets me control the speed of the animation and the duration of the graphic, all inside Premiere Pro. The renders are faster, and the work is faster. 

 

There is no way to control the position of a second line of text with pixel accuracy using expressions. Even if you stick with Extended Graphics, editing your content in that workspace will be faster than in a regular comp.

 

Here's a screenshot of one of my Extended Graphics comps that sets up a lower third graphic for multiple social media formats as well as HD and 4K videos for YouTube and Vimeo.

RickGerard_0-1685373072898.gif

Here's a link to a fairly decent Extended Graphics course.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

Hi

Thanks.

The next step is absolutely to have it working as a mogrt.

I've created a lot of mogrt:s that I've split the text to different layers to be able to use different font weights and sizes for each row but then you have to split the text and also have several textboxes in Premiere

What I want to achieve is to have one block of text that each row can be offset on the x axle.

Attaching an image so it's a bit clearer what i'm after.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

Skärmavbild 2023-05-29 kl. 17.46.52.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

you could have your text on 1 layer with hard returns between each line of text. then you could have 3 other text layers each one using an expression to take only line1, and line 2 and line 3 respectively. from there you can have individual control of those. Is that what you want ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

To have a hidden parent layer where I change the text and the it reflects to the 3 other layers?

Absolutly. That could work!

Do you know a expression that could solve that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

ya ill post it, let me see if one of my projects already has it

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

No worries, found one of your threads:

displayed a certain number of text lines from text layer in child composition 

I got it to work with!

Thanks!!

Skärmavbild 2023-05-29 kl. 20.21.53.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

Unfortunately, you will have to create a text layer for each row of text if you want to achieve pixel-perfect left edges.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

1st text layer for line 1 only

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 1;
if (txt.length >= n)
txt[n-1]
else
""

for 2nd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 2;
if (txt.length >= n)
txt[n-1]
else
""

 for 3rd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 3;
if (txt.length >= n)
txt[n-1]
else
""

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2023 May 29, 2023

Copy link to clipboard

Copied

but you will lose control for individual characters in the character palette

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

LATEST

Hi thanks again for the code.

It worked perfectly.

Working on another project where I've used the same approach and I'm trying to have the Children-text inherit the Parent/Master-text's style properties.

Parent/Master is tied to the essential graphics panel so i can control size, font, color...

I've tried the Ukramedia approach but that breaks the code of the children.

Get Text Styles From Another Layer in After Effects #Shorts - YouTube 

The line break still happen but it's not copying the actual text.

Any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines