Answered
Offset layers when resizing a composition
- June 17, 2024
- 1 reply
- 257 views
Hi all. Can someone explain to me the logic of shifting layers when changing the size of the composition?
It always seemed to me that it was done like this, but I don’t get the same result as when changing the size of the composition through the interface
var comp = app.project.activeItem;
var w = comp.width;
var h = comp.height;
var nW = 1920;
var nH = 1080;
var x = nW / w;
var y = nH / h;
writeLn(x)
writeLn(y)
var layer = comp.layer(1);
var position = layer.position;
var anchor = layer.anchorPoint
position.setValue([position.value[0] * x, position.value[1] * y]);
comp.width = nW;
comp.height = nH;
