Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Maintaining scale when moving back in Z space

  • Maintaining scale when moving back in Z space

    Posted by Drewhalasz on February 22, 2010 at 5:36 am

    With After Effect, is there a way to have an object maintain scale as you move it back in Z space? I found a script which could be purchased, but in Motion it’s just a matter of holding down a key as you move the object back.

    Is this an instance of Motion having something over on AE?

    Thanks

    Bartek Skorupa replied 16 years, 2 months ago 2 Members · 7 Replies
  • 7 Replies
  • Bartek Skorupa

    February 22, 2010 at 8:21 pm

    Try this one:

    Add an expression to the scale property:

    zoom = 1422.22;
    transform.scale*(1+transform.position[2]/zoom)

    This will work in the composition 1024×576 using square pixels.
    To find out what value should your “zoom” have – add a camera to your comp using 50mm preset. In the dialog box that adds camera – change units from millimeters to pixels, and see what zoom value you get. This will be the “zoom” value for your expression.
    You don’t even have to really add this camera. Just check the zoom value. You can copy this and paste to your expression.

    Bartek Skorupa
    Warszawa, Poland

  • Bartek Skorupa

    February 22, 2010 at 8:38 pm

    Ok, even better. Just copy the expression below and paste it to your scale:

    w=thisComp.width*thisComp.pixelAspect;
    zoom=w+w*0.388888;
    transform.scale*(1+transform.position[2]/zoom)

    This will work for every composition. Adding camera will have influance on the result.

    Bartek Skorupa
    Warszawa, Poland

  • Drewhalasz

    February 23, 2010 at 1:28 am

    Thanks for the expression!

  • Drewhalasz

    February 24, 2010 at 3:48 am

    Thanks again Bartek.

    The expression works except when I add a camera to the comp.

    Is there something I need to do once the camera is added?

    I’m surprised this question does not come up often. I used the facility to do this in Motion quite often. You could import a PSD file and separate all of the layers in Z space, but maintain the scale. Then you could interact with the layers with a camera.

  • Bartek Skorupa

    February 24, 2010 at 8:10 am

    In this case try this one:

    Let’s say that your camera is called “Camera 1”.
    Add an expression as follows to the scale property of the layer:

    ———–

    zoom=thisComp.layer(“Camera 1”).cameraOption.zoom;
    transform.scale*(1+transform.position[2]/zoom)

    ———–

    This is the same one I gave you in my first reply, but I just linked the “zoom” value to camera’s zoom.

    Bartek Skorupa
    Warszawa, Poland

  • Drewhalasz

    February 24, 2010 at 3:12 pm

    Thanks once again!

    Best,
    andrew

  • Bartek Skorupa

    February 25, 2010 at 10:25 pm

    I’ve just found something like this:

    https://aescripts.com/pt_multiplane/

    I think you were looking exactly for such solution.

    Bartek Skorupa
    Warszawa, Poland

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