Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Maintain logo position in resizing shape layer

  • Maintain logo position in resizing shape layer

    Posted by Justin Lundy on October 4, 2023 at 7:32 pm

    Hello!

    I’m creating a relatively simple lower third graphic with text, a background shape which resizes according to the length of text via the sourceRectAtTime expression, and a logo on the right side of the background shape (I attached a photo for reference). I’m trying to figure out a way to ensure the logo maintains the same position on the right side of the background shape automatically so I don’t have to manually adjust the logo’s position for each instance of the lower third.

    Any help is appreciated and thank you in advance!

    Brie Clayton replied 4 months, 2 weeks ago 3 Members · 3 Replies
  • 3 Replies
  • Julian Chojnacki

    October 6, 2023 at 1:30 pm

    Hi Justin,

    you could either attach the logo’s position to the left edge of the box or to the right edge of your text with some margin. The exact code depends on your setup.

    Here are some examples:

    // Right edge of the text

    // Logo parented to your text layer

    const { left, width, top, height } = parent.sourceRectAtTime();

    const margin = 50;

    [left + width + 50, top + height / 2];

    // Right edge of the box

    // Logo parented to your box layer

    const { left, width, top, height } = parent.sourceRectAtTime();

    const margin = 50;

    [left + width - 50, top + height / 2];

    Let me know if this works for you

  • Justin Lundy

    October 9, 2023 at 4:32 pm

    That worked perfectly! Thank you so much!

  • Brie Clayton

    October 9, 2023 at 6:04 pm

    Thanks for solving this, Julian!

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