Copy link to clipboard
Copied
Hello everyone,
I've desperately been trying to achieve this for weeks now: I have a series of videos with a different title everytime, but with the same animations and logos etc. So I went with Motion Graphics Templates, which saved me an awful lot of time. Still, I have a pretty stupid problem and I'm going crazy trying to find the solution:
I have one of the texts layers that is gonna be variable in length but needs to be centred at all time and it goes like this "Meeting with Person Name" (with the bold name). The only way to keep it automatically centred is to make the whole thing as one centred text layer but then I loose the ability to keep the "Person Name" bold (as soon as I put the MGT into a premiere timeline, the formatting is the same on the whole layer).
The way I've done it until now was to make two separated layers, one for each formatting, attach the "Person Name" layer to the right of the "Meeting with" layer and add a slider to offset the X axis position of the whole thing. Then I can write the different names every time, and offset with the slider, eyeballing it so it's centred. This is quite the annoying work around.
I've just spent two hours trying to search for a way to auto center two side by side layers with variable size on the X axis automatically without moving relative position, but it seems there's no way.
Do one of you guys have a solution? Maybe there's something much simpler that I haven't seen yet? (i hope)
Thanks in advance
So thank you Szalam,
The short answer is NO, you can't have different styles in the same text layer with Motion Graphics.
However, if you plan to achieve that because you want the total variable width of both styles to be centered at all times then you can do it. here's how i did it:
- Create 2 separate text layers, one for each style
- Make them aligned to the left and move them how you want them to appear next to each other
- Parent the second one to the first one
- In the X position of the first on
...Copy link to clipboard
Copied
I would try using an expression with the sourceRectAtTime() to push a right-aligned "Meeting with" layer to the left a certain amount based on the bold name layer's size.
Copy link to clipboard
Copied
hmm, can you elaborate?
Copy link to clipboard
Copied
You can use the sourceRectAtTime function in expressions to get the width of the name layer. Therefore, you can take the position of the name layer, minus half of its width and you will know the exact pixel position of the left side of that layer. Then, if you use that in the position for your "Meeting with" layer, it'll always land right up against the name layer. (I would suggest subtracting some arbitrary number more in your expression to scoot the "Meeting with" layer a bit further to the left so it's not actually touching the name layer.)
Copy link to clipboard
Copied
Or just add a space I guess, since I can precomp the whole thing. But holy hell this might be the solution, i'm gonna try this.
Copy link to clipboard
Copied
Let us know how it goes.
Copy link to clipboard
Copied
So thank you Szalam,
The short answer is NO, you can't have different styles in the same text layer with Motion Graphics.
However, if you plan to achieve that because you want the total variable width of both styles to be centered at all times then you can do it. here's how i did it:
- Create 2 separate text layers, one for each style
- Make them aligned to the left and move them how you want them to appear next to each other
- Parent the second one to the first one
- In the X position of the first one (so the whole thing since the second one is parented) use this expression:
Text1 = thisComp.layer("myfirstLayer");
Text2 = thisComp.layer("mySecondLayer");
Text1info = Text1.sourceRectAtTime(time);
Text2Info= Text2.sourceRectAtTime(time);
Text1Width= Text1Info.width;
Text2Width= Text2Info.width;
TotalWidth = Text1Width + Text2Width;
(thisComp.width - TotalWidth)/2
This should only work if Text1 doesn't change width, but by aligning it to the right instead and fiddling a bit with the script the whole thing should work.
Copy link to clipboard
Copied
I'm glad you found a solution.