Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Expression for Object Postion that is parented to a controller?

Cow Forums : Adobe After Effects

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Expression for Object Postion that is parented to a controller?
by Jordan Montreuil on Aug 24, 2008 at 7:37:14 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?



Respond to this post   •   Return to posts index

Re: Expression for Object Postion that is parented to a controller?
by Darby Edelen on Aug 25, 2008 at 7:40:29 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:

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

Darby Edelen

NVIDIA
Santa Clara, CA

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]