Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scale linked to Z position

  • scale linked to Z position

    Posted by Sam Pauwels on June 30, 2009 at 4:17 pm

    Hello there,

    I’m trying to find an expression that links scale to Z position.
    I’ve got 50someting layers that I control with a slider control in Z, they all have the same distance from each other. Now I would like to scale ’em back up again so there seems to be no Z depth, and it seems you get the original image back ( am I making myself clear?) If the camera is in front, nothing seems to have changed, but when you rotate, its an actual 3D scene.

    I’ve checked the forum already and some thing look like what I want, but then again not.
    Help, anyone?

    thnx

    Sam Pauwels

    Alberto Garcia replied 16 years, 6 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 30, 2009 at 5:17 pm

    I think this will do what you want:

    nominalDist = 888.9;

    C = thisComp.activeCamera;
    v1 = (toWorld(anchorPoint) – C.toWorld([0,0,0]));
    v2 = C.toWorldVec([0,0,1]);
    d = dot(v1,v2)

    value*(d/nominalDist)

    Set ‘nominalDist’ to the distance from the camera where you want the layers to not be scaled by the expression. The example above is set up for a 640×480 comp with the camera at [320,240,-888.9]. A layer at [320,240,0] won’t be affected by the expression.

    Dan

  • Alberto Garcia

    October 29, 2009 at 7:29 pm

    Hi!
    This was what I was looking for! But….
    Where is this expression supposed to go? In one of the layers or in the camera?

    Thanks!

  • Dan Ebberts

    October 29, 2009 at 8:20 pm

    The expression would be applied to the scale property of all the image layers (not the camera or lights).

    Dan

  • Alberto Garcia

    October 29, 2009 at 8:45 pm

    Wow! Quick response! Thanks
    Although, it turns out it wasn’t what I needed 🙁

    I’m trying to have a camera travel in the z position through a bunch of text layers and at the end these layers, while keeping their z position, would form certain shape.

    I have them placed in a circle already I could just move them in the z axis, move them and scale them to fit at the end of the animation, I was just wondering if there could be a way through expressions I could do this and save some time.

    Thank you so much again!

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