Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scale proportionate to z space

  • Scale proportionate to z space

    Posted by Peter Stenhouse on September 15, 2008 at 10:49 am

    Hey there. I was wondering if there was a script or expression that would scale an object proportionate to its distance in Z space so that it appears to stay its original size. I have to animate a subtle camera move from a photo and it would be great if I could push my cut out layers back and forward and have them scale to recreate the original photo automatically. distance can’t be measured from the camera, because I hope to move this about…
    anyway. Thanks in advance for the help.
    Sincerely
    Peter

    Peter Stenhouse replied 17 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 15, 2008 at 3:02 pm

    This may work for you. Start out with all your pieces at z = 0 and your camera on the z axis. Add a slider to each piece you want to reposition. Set each slider to 100. Add this position expression to each piece (changing “cameraZ” to the starting z position of your camera):

    cameraZ = -888.9;
    zControl = effect(“Slider Control”)(“Slider”);
    cameraPos = [thisComp.width/2,thisComp.height/2,cameraZ];
    (value – cameraPos)*zControl/100 + cameraPos

    Add this expression to the scale:

    zControl = effect(“Slider Control”)(“Slider”);
    value*zControl/100

    Reposition the pieces by adjusting the sliders. Slider values of less than 100 will move the pieces towards the initial camera position – values of greater than 100 will move them away. After adjusting the sliders, the image should still appear the same until you start moving the camera.

    Dan

  • Peter Stenhouse

    September 17, 2008 at 8:46 am

    Thanks alot Dan it works very well.
    cheers
    Peter

    small flowers crack concrete

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