Copy link to clipboard
Copied
when scaling layer up or down its position changes. how can i compensate for this shift keeping its relative position?
sample code:
function scale1(a,b,c){
var x2s = app.project.item(2).layer(a).property("Transform").property("Scale")
x2s.setValueAtTime(, [c,c]);
}
scale1(2,0,50)
Copy link to clipboard
Copied
If originally layer in the comp was centered and haven't been changed - it will stay in center.
However, if you are replacing source of the layer, it is possible to introduce the shift. Two steps are required:
1. Set anchorpoint to layer's center.
2. Set position to comp center.
Copy link to clipboard
Copied
As Tom10 says, the layer always scales around its anchor point. If it should stay centered, make sure the anchor point is in the middle of the layer. If you set the paragraph alignment of the text to "center", the anchor point should stay in the middle automatically.
See this tutorial for more control and details about the anchor point:
https://mamoworld.com/tutorials/anchor-control-pins-boxes-ae-tip-1
Find more inspiration, events, and resources on the new Adobe Community
Explore Now