Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression for Object Postion that is parented to a controller?

  • Expression for Object Postion that is parented to a controller?

    Posted by Jordan Montreuil on August 24, 2008 at 7:37 pm

    I have a light that is parented to a Null object. The null is keyframed to rotate so that the light is swinging along the axis of the null’s rotation.

    Now, I am trying to use an expression to link the light position value of a CC Glass effect to the position of the light. Unfortunately, the light is techinically stationary because the light is only moving via the null’s rotation.

    How can I link the CC Glass’s light position to the actual light in the comp? I tried doing it by hand but I can’t match the light’s position because of the easing of the keyframes. Is there an expression that points to an object’s relative position rather than its numerical position that I would normally pick whip to?

    Darby Edelen replied 17 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Darby Edelen

    August 25, 2008 at 7:40 am

    [Jordan Montreuil] “Is there an expression that points to an object’s relative position rather than its numerical position that I would normally pick whip to?”

    Yes.

    You’ll need to use layer space transformations, they sound scary, and they are at first, but they’re some of the most valuable expressions out there.

    To get the 3D position of your light you can use:


    l = thisComp.layer("My Light"); //The light layer
    l.toWorld([0,0,0]); //Convert the point [0,0,0] relative to the light (this point is the center of the light), into world space

    If you want to get the position of the light in composition space:


    l = thisComp.layer("My Light"); //The light layer
    l.toComp([0,0,0]); //Convert the point [0,0,0] relative to the light (this point is the center of the light), into composition space

    You can think of the difference between world space and composition space as the difference between the 3D position of something in the world (which doesn’t change as a camera moves) and the 2D position of something in the field of view (which changes as the camera moves).

    There are additional space transformations you can use, and I recommend you look them up in your expressions reference:

    https://livedocs.adobe.com/en_US/AfterEffects/8.0/WS3878526689cb91655866c1103906c6dea-79fd.html

    Darby Edelen

    NVIDIA
    Santa Clara, CA

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