Skip to main content
Inspiring
January 30, 2023
Answered

Anchor points when animating 'Size' property of shape

  • January 30, 2023
  • 2 replies
  • 348 views

I've set the anchor point to the top-right corner of my rectangle shape, but when I modify the 'Size' property, it resizes it from the centre.

 

I'm guessing this is due to the 'Position' property.

 

Is there an easy way of getting it to resize based on the anchor point instead?

 

This topic has been closed for replies.
Correct answer Mylenium

It's simply how parametric rectangle paths work. You could compensate it with a simple expression or convert to a spline-based shape. Expression for property as follows:

 

rSize=thisLayer.property("Rectangle 1").property("Rectangle Path 1").property("Size");

 

X=-rSize[0]*0.5;

Y=-rSize[1]*0.5;

 

[X,Y]

 

Mylenium

2 replies

Participant
June 21, 2023

Go directly under the “size” attribute and alt-click “Position.” Pickwhip that to Size, and type /2 to divide it in half. That’ll set the anchor point in the top-left corner. From there, go to your layer’s transform properties (NOT the shape transform properties), and alt-click “anchor point”

Mylenium
MyleniumCorrect answer
Legend
January 30, 2023

It's simply how parametric rectangle paths work. You could compensate it with a simple expression or convert to a spline-based shape. Expression for property as follows:

 

rSize=thisLayer.property("Rectangle 1").property("Rectangle Path 1").property("Size");

 

X=-rSize[0]*0.5;

Y=-rSize[1]*0.5;

 

[X,Y]

 

Mylenium