I have a compItem in AfterEffect of ratio 9:16
. I am writing a script to auto transform it to different size/ratios. For example to 16:9
and other etc.
If I duplicate the current compItem manually through AfterEffect and change the pixel size (from 1080:1920 to 1920:1080), it crops the video from top & bottom equally, which is fine.
But through the ExtendScript, if I duplicate & then update the width
& height
, it crops the video from only one side (bottom).
Following is the script I wrote. Any insights would be a great help, thanks.
var copies = {
'4:5': [1080, 1350],
'1:1': [1080, 1080],
'16:9': [1920, 1080]
};
var currentComp = app.project.activeItem;
for (var i in copies) {
var newCompItem = currentComp.duplicate();
var width = copies[i][0];
var height = copies[i][1];
newCompItem.name = i;
newCompItem.width = width;
newCompItem.height = height;
};
It can be achieved by following steps:
Null Object
in current composition.Null Object
.Centering the Null Object
would auto center the layers as it's their parents.