Skip to main content
Participant
December 15, 2023
Question

Is there a way to have a 75% zoom in after effect?

  • December 15, 2023
  • 5 replies
  • 2050 views

I know you couldn't do it before but maybe in 2024 there's a way? I want to have a 75% zoom on the playback windows, because 25% is to small to watch it but 50% is zoomed in my composition so I keep having to go and manual put it on ajust mode than zoom out everytime I have to make something go out of the screen, and put it back on ajust when I want to playback.

5 replies

Warren Heaton
Community Expert
Community Expert
May 28, 2024

It would be great to have the Magnification pop-up menu also be a text field, matching the behavior of Adobe Photoshop where the user can click and then enter "75".

I'm not sure I'd ever use 75%, but I'd vote for it to help it get attention as a feature request and, hopefully, consideration.

gargoylevfx
Participating Frequently
May 27, 2024

75% view has got to be the most used level of zoom. 100% only good for viewing or preview. 50% too small to see what you're doing properly. I've had a good look on AESCripts and can't see anything. Duik Angela has something that sort of does this but it'sa bit convoluted. Oviously I just want to use the mouse wheel to zoom in and out, so going to comp settings each time is clearly not viable when actually working. The script above by @yuelili works a treat. A fair compromise but it just needs it own UI window so it can be placed into the UI. Sadly I have no clue about writing scripts or I would just change the bit that is missing for putting the slider into a UI window. 

gargoylevfx
Participating Frequently
May 27, 2024

Well. with a little help from chatGPT this code seems to work to a point. Still can't seem to get a UI window to work but code gives a slider that can be scrolled up and down with a mouse wheel to get whatever zoom you want (albeit inverted) and no requirement to press "GO! button"

 

(function zoom() {
var mainPanel = this;

if (mainPanel instanceof Panel) {
buildUI(mainPanel);
} else {
mainPanel = new Window("palette", "AE Zoom Slider Box", undefined, {resizeable: true});
buildUI(mainPanel);
mainPanel.show();
}

function buildUI(thisObj) {
var res = "group { \
orientation: 'column', alignment: ['fill', 'fill'], \
zoomControl: Group { \
margins: 5, spacing: 5, orientation: 'column', \
controls: Group { \
orientation: 'row', \
less: Button { size: [25, 25], text: '-' }, \
B: Slider { size: [150, 25], minvalue: 1, maxvalue: 100, value: 50 }, \
more: Button { size: [25, 25], text: '+' }, \
}, \
manualInput: Group { \
orientation: 'row', \
zoomInputLabel: StaticText { text: 'Zoom (%):' }, \
zoomInput: EditText { size: [50, 25], text: '50' }, \
setZoomButton: Button { text: 'GO!', size: [40, 25] }, \
}, \
} \
}";

var myPanel = thisObj.add(res);

var btn_zoomIn = myPanel.zoomControl.controls.less;
var sld_zoomRatio = myPanel.zoomControl.controls.B;
var btn_zoomOut = myPanel.zoomControl.controls.more;
var zoomInput = myPanel.zoomControl.manualInput.zoomInput;
var setZoomButton = myPanel.zoomControl.manualInput.setZoomButton;

var g_zoomScaleStep = 5;
var g_magnification = 50;

(function initViewZoom() {
var zoomScale = app.activeViewer ? app.activeViewer.views[0].options.zoom : g_magnification / 100;
g_magnification = sld_zoomRatio.value = zoomInput.text = zoomScale > 1 ? 100 : Math.round(zoomScale * 100);
})();

btn_zoomIn.onClick = zoomCompView(0, sld_zoomRatio, g_zoomScaleStep);
btn_zoomOut.onClick = zoomCompView(1, sld_zoomRatio, g_zoomScaleStep);
sld_zoomRatio.onChange = sld_zoomRatio.onChanging = zoomCompView(2, sld_zoomRatio);

function zoomCompView(modeIndex, scriptUiSliderControl, step) {
var zoomStrategies = [
function (value, step) {
var scale = Math.max(Math.ceil(value / step) * step - step, 1);
return scale;
},
function (value, step) {
var scale = Math.min(Math.floor(value / step) * step + step, 100);
return scale;
},
function (value) {
return Math.round(value);
},
][modeIndex];
return function () {
if (!app.activeViewer) return (scriptUiSliderControl.value = g_magnification);
var zoomScale = zoomStrategies(scriptUiSliderControl.value, step);
app.activeViewer.views[0].options.zoom = zoomScale / 100;
g_magnification = scriptUiSliderControl.value = zoomInput.text = zoomScale;
};
}

setZoomButton.onClick = function () {
var zoomValue = parseInt(zoomInput.text);

if (isNaN(zoomValue) || zoomValue < 0 || zoomValue > 1000) {
alert("Please enter a valid zoom percentage (0-1000).");
return;
}

if (!app.activeViewer) {
alert("No active viewer.");
return;
}

app.activeViewer.views[0].options.zoom = zoomValue / 100;
sld_zoomRatio.value = g_magnification = zoomValue;
};

// Ensure the entered zoom level in input box is valid and within range
zoomInput.onChange = function () {
var zoomValue = parseInt(zoomInput.text);

if (isNaN(zoomValue)) {
zoomInput.text = "50"; // Default value
} else if (zoomValue < 0) {
zoomInput.text = "0";
} else if (zoomValue > 1000) {
zoomInput.text = "1000";
}
};
}
})();

Known Participant
January 27, 2024

you can use this script, copy this code and copy into a .jsx file,

 

then run it

 

input the value you want to zoom, like 75, and click the "GO!" button

 

(function zoom() {
    var win = new Window(
        "palette { \
            margins: 5, spacing: 5, orientation: 'column', \
            controls: Group { \
                orientation: 'row', \
                less: Button { size: [25, 25], text: '-' }, \
                B: Slider { size: [150, 25], minvalue: 1, maxvalue: 100 }, \
                more: Button { size: [25, 25], text: '+' }, \
            }, \
            manualInput: Group { \
                orientation: 'row', \
                zoomInputLabel: StaticText { text: 'Zoom (%):' }, \
                zoomInput: EditText { size: [50, 25], text: '50' }, \
                setZoomButton: Button { text: 'GO!', size: [40, 25] }, \
            }, \
        }"
    );
    win.show();

    var btn_zoomIn = win.controls.less;
    var sld_zoomRatio = win.controls.B;
    var btn_zoomOut = win.controls.more;
    var zoomInput = win.manualInput.zoomInput;
    var setZoomButton = win.manualInput.setZoomButton;

    var g_zoomScaleStep = 5;
    var g_magnification = 50;

    (function initViewZoom() {
        var zoomScale = app.activeViewer ? app.activeViewer.views[0].options.zoom : g_magnification / 100;
        g_magnification = sld_zoomRatio.value = zoomInput.text = zoomScale > 1 ? 100 : Math.round(zoomScale * 100);
    })();

    btn_zoomIn.onClick = zoomCompView(0, sld_zoomRatio, g_zoomScaleStep);
    btn_zoomOut.onClick = zoomCompView(1, sld_zoomRatio, g_zoomScaleStep);
    sld_zoomRatio.onChange = sld_zoomRatio.onChanging = zoomCompView(2, sld_zoomRatio);

    function zoomCompView(modeIndex, scriptUiSliderControl, step) {
        var zoomStrategies = [
            function (value, step) {
                var scale = Math.max(Math.ceil(value / step) * step - step, 1);
                return scale;
            },
            function (value, step) {
                var scale = Math.min(Math.floor(value / step) * step + step, 100);
                return scale;
            },
            function (value) {
                return Math.round(value);
            },
        ][modeIndex];
        return function () {
            if (!app.activeViewer) return (scriptUiSliderControl.value = g_magnification);
            var zoomScale = zoomStrategies(scriptUiSliderControl.value, step);
            app.activeViewer.views[0].options.zoom = zoomScale / 100;
            g_magnification = scriptUiSliderControl.value = zoomInput.text = zoomScale;
        };
    }

    setZoomButton.onClick = function () {
        var zoomValue = parseInt(zoomInput.text);

        if (isNaN(zoomValue) || zoomValue < 0 || zoomValue > 1000) {
            alert("Please enter a valid zoom percentage (0-1000).");
            return;
        }

        if (!app.activeViewer) {
            alert("No active viewer.");
            return;
        }

        app.activeViewer.views[0].options.zoom = zoomValue / 100;
        sld_zoomRatio.value = g_magnification = zoomValue;
    };

    // Ensure the entered zoom level in input box is valid and within range
    zoomInput.onChange = function () {
        var zoomValue = parseInt(zoomInput.text);

        if (isNaN(zoomValue)) {
            zoomInput.text = "50"; // Default value
        } else if (zoomValue < 0) {
            zoomInput.text = "0";
        } else if (zoomValue > 1000) {
            zoomInput.text = "1000";
        }
    };
})();
gargoylevfx
Participating Frequently
May 26, 2024

This script works perfectly for this so thanks but is there a way to get it to sit in a UI window so that it can be permanently added to a layout? Presently it opens two windows. One for the slider and another for the panel but slider needs to be in a panel ideally.

 

(See image attached)

Participant
May 27, 2024

I haven't been using after effect that much recently but i'll try this out next time thanks a lot!

Inspiring
December 16, 2023

You can try changing the resolution of the viewport, click on the viewport, and press the "`" button (under the ESC button) to open the viewport only. When you finish watching, press "`" again to turn your layout to normal.

Community Expert
December 16, 2023

Set the Magnification Factor to FIT instead of picking a percentage. Set the Comp Panel Resolution to Auto.

AnthonySneed.film
Known Participant
April 25, 2024

What I don't understand is why doesn't Adobe just simply have this as an option right between 50 and 100%?

 

It's still a bit of a pain when it can be much simpler