Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Parenting two objects so they don’t seperate when camera moves…

  • Parenting two objects so they don’t seperate when camera moves…

    Posted by Evan Seitz on September 1, 2009 at 11:06 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?

    Darby Edelen replied 16 years, 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • Darby Edelen

    September 2, 2009 at 2:30 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

  • Evan Seitz

    September 2, 2009 at 4:54 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”.

  • Curious Turtle

    September 2, 2009 at 6:11 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

  • Darby Edelen

    September 2, 2009 at 9:16 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

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