Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simulate Pan-Behind Tool

  • Simulate Pan-Behind Tool

    Posted by Greg Digenti on June 21, 2009 at 7:39 pm

    I’m posting this again because I wasn’t getting any help on my last post on the subject, but I really feel this would be a very helpful expression not just to me, but to many others. And it should be a nice challenge for you math guys (calling Dan Ebberts).

    I’m trying to simulate the function of the pan-behind tool so that I can animate the movement of a layer’s anchor point without the layer moving. If you use the pan-behind tool on the anchor point of a layer, you’ll see that what it’s actually doing is moving the layer in the opposite direction. This is all well and good until you attempt to keyframe the anchor point’s movement, at which time it no longer works as expected.

    If I could come up with an expression to add to the Position of a layer that moves it inversely to the movement of the anchor point, I could do this.

    What I did was added a Null Object to the scene and linked its Position property to the Anchor Point property using the pickwhip. I then added this code to the Position property of the layer:

    tempX=thisComp.layer(“Null 1”).transform.position[0];
    tempY=thisComp.layer(“Null 1”).transform.position[1];
    x=tempX+571; //571 is the width of the comp – the width of the layer
    y=tempY+637.5; //637.5 is the height of comp – the height of the layer
    [x,y]

    It works perfectly until I rotate the layer, at which point when the Anchor Point is moved, the layer also shifts position. If someone who is good at math can figure out what needs to be done so that rotation is taken into account, this expression would very helpful to me and I imagine a great many other people.

    THANKS!

    Dan Ebberts replied 17 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Greg Digenti

    June 21, 2009 at 7:54 pm

    I may have solved this. Not sure why this never occurred to me, but in case anyone else has had this issue, all you need to do apparently is keyframe the anchor point AND the position of the layer at the points in the timeline before and after moving the anchor point, and use the Pan-Behind tool to move the anchor point. This will allow you to animate the movement of the anchor point without the layer moving, and it shouldn’t be affected by rotation as long as the rotation occurs after the anchor point movement has stopped.

    Simple but effective.

  • Dan Ebberts

    June 21, 2009 at 9:27 pm

    That’s the only way I’ve ever been able to do it. The anchor point and position properties seem to be too hopelessly intertwingled to be able to do it with an expession.

    Dan

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