Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Replace footage –> Auto-scaling footage

  • Replace footage –> Auto-scaling footage

    Posted by Mats Jacobsson on September 21, 2007 at 9:33 am

    Hi!
    I might need help with a script…

    I’m doing a lot replace footage where the footage is in different sizes every time. I would like the script to adjust the pixel width to 500 px on the footage in the comp. I guess this is a simple task, but I’m not that into scripting…

    I couldent find any script similar to this in the forum…

    Thanks a lot!

    Mats Jacobsson replied 17 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Jeff Mcbride

    September 21, 2007 at 2:36 pm

    Great idea for a script, let me know if it works out. It would be nice to be able to set scale to match.

    Jeff McBride
    Motion Graphic Designer/Editor
    LimeGreen
    Chicago, IL

    http://www.limegreenproductions.com

  • Mats Jacobsson

    May 30, 2008 at 5:34 pm

    It’s been a while since this I posted my question, but here’s a solution that works fine for me. Hope it can help you too!

    /Mats

    ————————————-

    MaxWidth = 650; //Max width in pixels
    MaxHeight = 400; //Max height in pixels

    PixWidth = source.width;
    PixHeight = source.height;

    factor = MaxWidth / PixWidth;
    NewWidth = transform.scale[0] * factor;
    NewHeight = transform.scale[1] * factor;

    if(NewHeight >= MaxHeight) {
    faktor = MaxHeight / PixHeight;
    NewWidth = transform.scale[0] * factor;
    NewHeight = transform.scale[1] * factor;
    }

    [NewWidth,NewHeight]

    ——————————–

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