Fit2Frame




Version: 1.1 Sign up to be notified by email when a new version of this script is posted
Fits selected layers (they can be different sizes and pixel aspect ratios) proportionally to fill the Comp frame by giving you the choice of either cropping or letterboxing.
Download includes 2 scripts:
- Fit2Frame which fits all the selected layers in a comp
- Fit2Frame-BatchComps which fits all layers from selected comps in the project panel
Version History
- 1.1 – Added Fit2Frame-BatchComps to download 01/2010
- 1.1 – Added rotation consideration 01/2010
- 1.0 – Initial release 08/2005
The definitive collection of scripts and plugins for Adobe After Effects







I’m wondering if there is a way to get an image to fill the screen and be the comp size. As of now it has the option of either letter box (e.g. will make a portrait pictures height match the frame but the width will be cropped smaller) or crop (which will make the width fit but the height will still be out of the frame) for example I need to make all the layers the same size for a wall effect animation.
Either way this script saved me a lot of time.
Thanks
Are your layers rotated? Otherwise, wouldn’t Layer->Transform->Fit to Comp do the trick?
If you have to deal with rotated images it’s very simple to modify the script to do fit to comp just let me know and i’ll modify it for you.
The script works incorrectly when Pixel Aspect Ratio is not Square
It can be visible when Aspect Ratio of the Image and the Comp is near same.
Here is the mistake:
var myLayerAspectRatio = (myWidth/myHeight);
var myCompAspectRatio = (myComp.width/myComp.height);
it should be
var myLayerAspectRatio = (myWidth*myLayer.source.pixelAspect/myHeight);
var myCompAspectRatio = (myComp.width*myComp.pixelAspect/myComp.height);
Do your following scripts work in CS5?
Audio2Markers
PhotoOrientationFixer
Fit2Frame
Thanks.
Yes to all. As a bonus I added Fit2Frame-BatchComps to the Fit2Frame download. Allows you to batch fit layers for many comps at once.
how am i supposed to apply this?
Select the layers you would like to fit to the comp and run the script.