Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions script to modify a solid’s dimensions

  • script to modify a solid’s dimensions

    Posted by David Bowman on October 5, 2010 at 7:17 am

    Hi,

    I need a way to modify a layer solid’s width and height with a script (similar to included example). I have looked far and wide, and I can’t seem to find a way of accessing these properties.

    Basically, I have a ton of solids that have been scaled to various dimensions. I’d like to reset the scale to 100% and have the layer maintain its shape by resizing its width and height parameters to offset the scale correction.

    So if you had a solid that was 200×200, but had been scaled to 50% x 75%, you could run a script that resized the layer to 100×150, and reset the scale to 100%.

    Any help would be appreciated!

    var layer = app.project.activeItem.selectedLayers[0];
    var wid = layer.source.width;
    var ht = layer.source.height;
    function resizeSolid()
    {
    wid.setValue(100)
    ht.setValue(150)
    }

    resizeSolid();

    Dan Ebberts replied 15 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    October 5, 2010 at 3:07 pm

    I think you’d have to create a new solid, replace the original solid’s source with the new solid’s source, then delete the new solid. At the end of the script, you could have it run the Remove Unused Footage menu command to get rid of the original solid sources.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy