Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions: Moving one layer in relationship with another layer.

  • Expressions: Moving one layer in relationship with another layer.

    Posted by Thomas Gabrielsen on August 7, 2006 at 1:58 pm

    Hello

    I’m new to Expressions in AE so I turn to you guys for some help. I want one layer to move horisontal in relationship with another layer (for adding some 3D effect to the animation). From my scripting experience in actionscript I’ve come up with this:
    thisLayer.position = thisComp.layer(“keyframe_animated_layer”).position*0.5;
    This expression works, but it animates both the X and Y values. I havent found the syntax for accessing only the X values. Can someone point me in the right direction, and tell me if there is a more proper way to do this.

    Thanks,
    Thomas

    Thomas Gabrielsen replied 19 years, 9 months ago 3 Members · 5 Replies
  • 5 Replies
  • Thomas Gabrielsen

    August 7, 2006 at 2:21 pm

    OK, I dont know how many times this has happened to me, but I found one way to do it:

    thisx = thisLayer.position[0];
    thisx = thisx+ (thisComp.layer(“i_animert”).position[0]*0.5);
    [thisx, 100]

    I’m still interested in comments on this though. 😉

    Thanks,
    Thomas

  • Ryan Hill

    August 7, 2006 at 4:56 pm

    What is there left to say? Except maybe your last line could be

    [thisx, thisLayer.position[1]]

    And then you can control your Y value normally instead of coding it.

  • Mike Clasby

    August 7, 2006 at 5:17 pm

    If you start with:

    [position[0], position[1]]

    and highlight, then pickwhip the “position[0]” to the X value of the layer “i_animert” you get:

    [thisComp.layer(“i_animert”).position[0],position[1]]

    To take it to 3D (you’ve probalby already figured it out) if you wanted to wiggle the Y in a 3D layer it would be:

    [position[0],wiggle(5,20)[1],position[2]]

  • Thomas Gabrielsen

    August 8, 2006 at 8:31 am

    RobotHero: Thanks, good point!

  • Thomas Gabrielsen

    August 8, 2006 at 8:34 am

    yikesmikes: I meant pseudo-3D, by making a object that is closer to the camera moving slower than the background. But thanks anyway 😉

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