Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Aligning a Lower third to a specific position in the based on the with of a box

• Aligning a Lower third to a specific position in the based on the with of a box

Posted by on November 22, 2023 at 3:28 pm

Hi everyone,

I’m creating a L3 Mogrt. there are text boxes that react to the width of the text.

My question is: These text boxes are center aligned, and therefore I’m not able to anchor there x position with my expression knowledge.

Is there a way for the Null to calculate what the largest box is, and have the left edge of that largest box fix itself to an assigned x – Pos without loosing the center alignment of other boxes?

Here are some examples of that I need it to do and my timeline.

Many thanks,

Emma

replied 3 months ago 3 Members · 3 Replies
• 3 Replies
• Dan Ebberts

November 22, 2023 at 4:39 pm

Try this for the null’s position (set leftEdge to your desired x value):

leftEdge = 35;
L1 = thisComp.layer("Shape Layer 1");
x1 = L1.toComp([L1.sourceRectAtTime(time,false).left,0])[0];
L2 = thisComp.layer("Shape Layer 2");
x2 = L2.toComp([L2.sourceRectAtTime(time,false).left,0])[0];
L3 = thisComp.layer("Shape Layer 3");
x3 = L3.toComp([L3.sourceRectAtTime(time,false).left,0])[0];
xMin = Math.min(x1,x2,x3);
delta = leftEdge - xMin;
value + [delta,0]
• Emma Beinish

November 22, 2023 at 4:53 pm

Hi Dan,

This has magically worked, thank you so much this is amazing 🌟

• Brie Clayton

November 22, 2023 at 8:37 pm

Thanks for solving this Dan!

We use anonymous cookies to give you the best experience we can.