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

how to scale while keeping the layer center position

Explorer ,
Jul 07, 2019 Jul 07, 2019

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)

TOPICS
Scripting
7.3K
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 ,
Jul 07, 2019 Jul 07, 2019

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.

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
Community Expert ,
Jul 08, 2019 Jul 08, 2019
LATEST

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

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
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