Skip to main content
Participating Frequently
October 31, 2023
Answered

Scale layer in multiple compositions?

  • October 31, 2023
  • 2 replies
  • 1195 views

When i work with a template, i have to import a lot of photos and the photos have different size. For each Photo Holder composition, i need to scale the photo to make it fit to comp, that keeps happening over and over on every photo, this make me fell sick.
I tried several scripts on aescripts.com, but all of them do same "Scale Composition" script, what was built in AE. So, anyone knows there is any script that can select multiple compositions and then choose "scale layers"?

This topic has been closed for replies.
Correct answer Mathias Moehl

I just wrote an Automation Blocks tool, which does exactly what you need:

 

 

Just select some comps and it will scale all layers contained in them to fit exactly into the comp.

The tool is now in the Community Library at this path:

Layer Properties/Scale/Scale All Layers In Selected Comps To Fit Into Comp

 

You can

1. download the xml of the tool here

2. install the free trial of Automation Blocks, load the xml of the tool into Automation Blocks and run it.

2 replies

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
October 31, 2023

I just wrote an Automation Blocks tool, which does exactly what you need:

 

 

Just select some comps and it will scale all layers contained in them to fit exactly into the comp.

The tool is now in the Community Library at this path:

Layer Properties/Scale/Scale All Layers In Selected Comps To Fit Into Comp

 

You can

1. download the xml of the tool here

2. install the free trial of Automation Blocks, load the xml of the tool into Automation Blocks and run it.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Alex White
Legend
October 31, 2023

Create "aev_after.jsx" script under the folder with your images with the following content:

(function () {
    try {
        if (!app.project.selection.length || (!app.project.activeItem)) return !!alert("Please, open the composition and select layers");
        app.beginUndoGroup("aev_after");
        var importedProject = app.project.selection[app.project.selection.length - 1];
        var myComp = app.project.activeItem;
        var layer = myComp.selectedLayers[0];
        app.executeCommand(2733); // fit to comp height
    } catch (e) {
        alert(e.toString() + "\nScript File: " + File.decode(e.fileName).replace(/^.*[\|\/]/, '') +
            "\nFunction: " + arguments.callee.name +
            "\nError on Line: " + e.line.toString());
    } finally {
        app.endUndoGroup();
    }
})()
 

 

Then use Aeviewer to import files. It will automatically pick up this script and resize images

hungnd.gtAuthor
Participating Frequently
October 31, 2023

Thank you Alex. I work, but it have 2 problems:

1. It just work with single comp. I have to open a comp and run the script. I looking for the way that i can select multiple comps in Project panel (like Selected Comps Changer script)

2. This script only scale by height, it can't distinguish Width or Height. If the height of photo to high, the width of photo won't fit. (i found Dojo Expander script can do that).

Alex White
Legend
October 31, 2023

So you need to open each of the selected comps and scale the first layer to fit the comp dimensions?

Or you need to scale all layers inside each comp?