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

Shape layer resizing from non-centered anchor point

Explorer ,
Dec 22, 2020 Dec 22, 2020

I'm sorry the title is confusing. I'm not sure how to describe this more succintly, but an example will tell you what I'm after:

 

Temp screen shot.pngexpand image

 

I have a shape layer, a rectangle with rounded corners. I want it anchored from the top edge and I want to maintain the same radius of the rounded corners no matter what size changes I make to the rectangle. The size property seems to ignore both the layer anchor point and the (smaller) shape anchor point. Changes to the size property are anchored in the center of the shape. All I can get to work is an expression. It works great, but there must be an easier way that I'm missing! Can anyone tell me an easier way?

 

Here's my expression solution:

 

Temp screen shot.pngexpand image

 

On the Rectangle Path 1 > Position property

x = content("Rectangle 1").content("Rectangle Path 1").position[0];
y = content("Rectangle 1").content("Rectangle Path 1").position[1];
y += .5*content("Rectangle 1").content("Rectangle Path 1").size[1];
[x,y]

Essentially I have the shape positioning itself according to the size property, freezing the top edge in place no matter what height changes I make to Rectangle 1.

 

Any tips appreciated. Thanks!

TOPICS
Expressions , How to
7.5K
Translate
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

Valorous Hero , Dec 22, 2020 Dec 22, 2020

This is how it's done. However, it's much more intuitive to apply the Expression to the Rectangle's Content>Transform>AnchorPoint property.

And your Expression can be simplified since you're only wanting to offset the AnchorPoint's y value.

y = -.5*content("Rectangle 1").content("Rectangle Path 1").size[1];
[0,y]

Translate
Valorous Hero ,
Dec 22, 2020 Dec 22, 2020

This is how it's done. However, it's much more intuitive to apply the Expression to the Rectangle's Content>Transform>AnchorPoint property.

And your Expression can be simplified since you're only wanting to offset the AnchorPoint's y value.

y = -.5*content("Rectangle 1").content("Rectangle Path 1").size[1];
[0,y]

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
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 ,
Dec 30, 2020 Dec 30, 2020

Thank you Roland!

Translate
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
Valorous Hero ,
Dec 30, 2020 Dec 30, 2020

It took you a while to come back onboard, Michael.
😉

Thanks for replying and have a great year ahead.

Do keep us in mind as you push ahead in 2021 — Happy New Year to You and Your Lovely Ones.

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
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
New Here ,
Oct 27, 2023 Oct 27, 2023

Is there any way to use this expression for both X and Y axes? I've been messing around for like an hour trying to get my rectangle to grow from the bottom left corner, to no avail.

Translate
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
New Here ,
Feb 13, 2025 Feb 13, 2025
LATEST

I reset my password just to answer you (even tho you propably dont need it anymore). After a lot of trial and error, this was my solution i put as an expression on the "anchor"-property:

x = content("Rechteck 1").content("Rechteckpfad: 1").position[0];
y = content("Rechteck 1").content("Rechteckpfad: 1").position[1];
x += .5*content("Rechteck 1").content("Rechteckpfad: 1").size[0] *-1;
y += .5*content("Rechteck 1").content("Rechteckpfad: 1").size[1] *-1;
[x,y]

the "*-1" i put at the end was to make it start from the top left corner, otherwise it was the bottom right. The other corners i didnt try – but maybe this will help someone. 

Translate
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
New Here ,
Mar 29, 2021 Mar 29, 2021

It's great to have a solution but how lame is it that we need to write code to overcome a system that completely ignores 2 anchor points! 🙂 

Translate
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
New Here ,
Sep 13, 2022 Sep 13, 2022

Just another way Adobe products actively work against it's users.

Translate
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 ,
Sep 22, 2023 Sep 22, 2023

@Roland Kahlenberg 's solution works perfectly. It could also be applied to the x-axis:

x = -.5*content("Rectangle 1").content("Rectangle Path 1").size[0];
[x,0]

 

GabrieleLS_0-1695387940082.pngexpand image

 

Translate
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
New Here ,
Jun 07, 2024 Jun 07, 2024

It's really helped me bro. Thanks a lot

Translate
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