Skip to main content
Inspiring
April 15, 2023
Question

Match width of largest shape layer

  • April 15, 2023
  • 1 reply
  • 621 views

Hello Folks,

I'm creating a responsive MOGRT where the background shape layers behind the Speaker Name and the Speaker Title text resize depending on the width of each text layer (See attached screen shot). 

However, what I need to accomplish now is how to make one shape layer match the width of the widest of the background shape layers. For example: IF the Speaker Name background shape (which is defined by the width of the Speaker Name text) is longer than the Speaker Title  THEN the Speaker Title background shape should resize to match the width of the Speaker Name background shape. I also would like to do the opposite so that at all times both backgrounds are the same width depending if Speaker Name or Speaker Title are the longest of the two. I'm using AE 2023 on Mac.

Any guidance on how to successfully accomplish this would be most appreciated. Or any other suggestions on how to accomplish the same effect are also appreciated.

This topic has been closed for replies.

1 reply

Mylenium
Legend
April 15, 2023

Any tutorial involving sourceRectAtTime() will do. It only needs to be applied to both layers and a comparison with an if()else() statement added.

 

Mylenium

r5dsignAuthor
Inspiring
April 15, 2023

Thanks for the prompt reply Mylenium. Yes, I had a feeling I needed an IF/ELSE statement but that's where I need more guidance. See attached AE project (updated now but same effects). As you see, I'm already using sourceRectAtTime() for resizing background shapes to text layers. 
Thanks again for any advice.