Jump to content
Sign in to follow this  
redwards

Expression help. Z scale

Recommended Posts

I was wondering if there is an expression for this...

 

I have multiple layers and I want to move them in Z, but I want them to scale to compensate for the new distance.

So it looks like nothing has changed in a front view, but when you rotate the camera you notice that the layers are all spaced out.

 

I know this is possible to do by hand but I have a lot of layers and think something like this would cut down time.

 

Thanks in advance for reading/helping with this.

Share this post


Link to post
Share on other sites
this is a script, which means you put it in your AE>scripts folder and run it by going to File>Run Scripts.

http://www.aenhancers.com/viewtopic.php?t=...1d1bcb93e69cb9e

 

I love the elegant simplicity of the approach - by moving the anchor point of a layer to the centre it is only necessary to adjust the scale of the layer to make it keep the same apparent size, not the x and y positions.

 

This will make 2.5D layouts a breeze! Sadly once you have moved all your layers in z space and removed the script, it seems you can't reapply it, which is fair enough. You just have to get it right in the first place!

Share this post


Link to post
Share on other sites

I just removed and re-added no sweat.

 

If you don't want to mess with the script, here's the expression itself here (slightly modified). Of course you have to create the camera yourself, and you can't remove the expression to apply the numbers. Pretty simple, and like basilisk said 'elegent.'

 

camZoom = -thisComp.layer("Camera 1").transform.position[2]; //pickwhip to camera Z-Position

distance = position[2] + camZoom;

scale * (distance / camZoom);

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...