Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Expression that auto fits placeholder to comp.

  • Expression that auto fits placeholder to comp.

  • Finn Hitchcock

    March 29, 2020 at 12:25 pm


    Could anyone help me out with an expression that auto fits a placeholder to comp when the footage changes. It can be either width or height as it’s square.

    Thanks in advance!

  • Evan Jenkins

    March 29, 2020 at 6:25 pm

    Yes go to the scale property of your placeholder and add an expression.

    lw = thisLayer.width;
    lh = thisLayer.height;
    cw = thisComp.width;
    ch = thisComp.height;
    x = 100;
    y = 100;

    aRC = cw/ch;
    arL = lw/lh;

    if(arL > aRC){
    x = cw/lw*100;
    y = x
    }else {
    y = ch/lh*100;
    x = y


    Evan Jenkins
    Aspen Films Inc.

  • Tomas Bumbulevičius

    April 4, 2020 at 9:37 am

    Hey Finn, Evan’s response above is spot on. In case you want to learn more about this with reasons behind, you can check my tutorial here:

    Find out more:
    Motion Graphics Design & After Effects Tutorials
    On YT
    On VH

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Viewing 1 - 3 of 3 posts

Log in to reply.

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