ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Parenting two objects so they don't seperate when camera moves...

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Evan Seitz
Parenting two objects so they don't seperate when camera moves...
on Sep 1, 2009 at 11:06:28 pm

I have a simple camera moving from left to right. There is a traffic light on one layer and a red lens flare on the second. When the camera moves, these two objects don't stay together. I tried whipping the position of the red light to the traffic light but I couldn't make it work. What should I do?


Return to posts index

Darby Edelen
Re: Parenting two objects so they don't seperate when camera moves...
on Sep 2, 2009 at 2:30:06 am

I'm guessing the red traffic light is a 3D layer? If it is, you can apply your lens flare to a black 2D comp-sized solid at the top of your layers set to 'add' or 'screen' then use a simple expression to link the position of the lens flare (in 2D) to the position of the red traffic light (in 3D). Try applying this expression to the lens flare center:

l = thisComp.layer("RedLight"); //this points to your Red Light layer
l.toComp(l.anchorPoint); //this makes the Lens Flare's 2D coordinate line up with the location of the Red Light layer's anchor point in 3D


Note that the lens flare will 'attach' itself to the anchor point of the red light layer, so if your anchor point isn't where you want it you can use the Pan Behind tool (Y) to move the anchor point where you'd like it on the layer.

Darby Edelen


Return to posts index

Evan Seitz
Re: Parenting two objects so they don't seperate when camera moves...
on Sep 2, 2009 at 4:54:34 am

As to what to type in when I option/alt click the position keyframe for the 2d lens flare, what do I type in "exactly"?

thisComp.layer("RedLight");toComp(l.anchorPoint);


I'm not sure if "RedLight" means to whip to something or actually type in "RedLight" - the same goes for "1.anchorPoint".




Return to posts index


Ben Heusner
Re: Parenting two objects so they don't seperate when camera moves...
on Sep 2, 2009 at 6:11:31 pm

Basically Alt-click in the Flare Center property and paste in Darby's expression.

If your Red Light layer is not called "RedLight" then select everything in the first line after "l =" and pickwhip your Red Light layer. This will type in the correct layer name for you.

Simple as that.

Hope that helps,
Ben

Curious Turtle Pro Video
Training | Editing | Support
Out Now - Film Wash Color Effects Vol. 3
for After Effects & Apple Color


Return to posts index

Darby Edelen
Re: Parenting two objects so they don't seperate when camera moves...
on Sep 2, 2009 at 9:16:21 pm

[Evan Seitz] "the same goes for "1.anchorPoint"."

Ben covered the other part of your question. That isn't a '1' it's a lower case L, as in the variable that contains the layer 'RedLight' (or whatever your layer is named).

Darby Edelen


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]