Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Photoshop layers to 3D, scaled to look 2D…

  • Photoshop layers to 3D, scaled to look 2D…

    Posted by Paul Maguire on November 10, 2009 at 10:59 am

    Hi.

    I’ve had a look around and there are some pointers to a solution to this (so many people seeking the same info!). But no matter what, I can’t quite get this to work.

    What I need to do is very simple – import a Photoshop layered document and ‘spread’ it into z space – I have this already: z position * (thisLayer.index * dXbetweenLayers). This pushes the layered document into the 3D scene, with the topmost layer z = 0. So far so good. The Photoshop document looks crazy of course as it’s broken up and deepest layers are furthest away…

    Now what I really want is to be able to scale up the layers respectively so that from the camera viewpoint it looks exactly as it does in 2D, so that when I pan the camera it fractures up etc. So I need an expression for scale which relates z position to scale, based on the camera focal length (I think).

    The maths for this must be simple! I’ve been trying to resolve it but to no avail. Is it an inverse square law? Does it relate to the focalLength of the camera, in mm????. Can anyone help?

    Regards, Paul.

    Bryan Golder replied 16 years, 2 months ago 4 Members · 4 Replies
  • 4 Replies
  • Xinlai Ni

    November 10, 2009 at 4:22 pm

    It’s as simple as linear scale:
    Assuming your topmost text layer is at z=0 plane, and your camera is sitting at some negative z coordinate looking toward z+ direction (this is important!), apply this to the scale property of each text layer:
    cameraZ = thisComp.layer(“Camera 1”).position[2];
    s = 100 * (cameraZ – position[2]) / cameraZ;
    [s, s, s]

    Xinlai Ni
    Software Engineer, Google Inc.

  • Paul Maguire

    November 10, 2009 at 6:04 pm

    Excellent – thanks. I was *so* close…

    Lots of creative mileage using this technique IMHO. I’m going to attempt to augment this code slightly – perhaps release it from being tied to the z axis and use perpendicular distance instead…

    Thanks again.

    Regards, Paul.

  • Todd Kopriva

    November 11, 2009 at 1:12 am

    See “Importing PSD files as 3D” scenes on this page for a script from Paul Tuersley that will help you to do what you’re looking for.

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    putting the ‘T’ back in ‘RTFM’ : After Effects Help on the Web
    ———————————————————————————————————
    If a page of After Effects Help answers your question, please consider rating it. If you have a tip, technique, or link to share—or if there is something that you’d like to see added or improved—please leave a comment.

  • Bryan Golder

    March 4, 2010 at 4:28 pm

    Thanks for that equation Xinlai. Very helpful!

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