Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions animate anchor point without moving layer

  • animate anchor point without moving layer

    Posted by Greg Digenti on June 19, 2009 at 2:30 am

    I need to animate a layer so it rotates around different points at different times. I’ve tried using multiple nulls and parenting them to one another, but there are so many different rotations in the animation that I need to rotate around, things always get out of whack as I try to adjust one of them.

    I’d like to be able to animate the anchor point to move to each position on the layer where I want it to rotate around, but the problem is that when the anchor point moves, the layer moves with it (the pan-behind tool won’t help in this case, it only messes up the rest of the animation).

    My thought was to add an expression to the Position of the layer which will in effect cancel out the movement of the Anchor Point. This way, moving the anchor point wouldn’t affect the position, but the layer can still rotate around the anchor point.

    Obviously my problem is I can’t figure out the expression to add to the layer’s Position. Something else that needs to be taken into account is that the expression still works once the layer is rotated.

    Griffin Englander replied 8 years, 11 months ago 3 Members · 5 Replies
  • 5 Replies
  • Greg Digenti

    June 19, 2009 at 2:42 am

    I’ve noticed that using the pan behind tool works exactly how I need the expression to work. It adjusts the Position of the layer to counteract the movement of the Anchor Point. If I could just figure out how to recreate this action with an expression.

  • Greg Digenti

    June 19, 2009 at 3:08 am

    Sorry to keep responding to my own post, but I feel like I’m getting close so I thought I’d post this in case it helps anyone reading this.

    What I’ve done is 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 I move the Anchor Point, the layer also shifts position.

  • Greg Digenti

    June 19, 2009 at 8:31 pm

    That’s an interesting concept, but I’d really like to figure out how to make this expression work. I know it has to be possible, and it would be really helpful to me and I imagine a lot of other people.

    I’m surprised Dan Ebberts hasn’t chimed in here, it seems right up his alley. It’s going to require some pretty tricky math to accommodate the layer rotation, but I know he can probably pretty easily wrap his brain around it.

  • Nino Kapetanovic

    June 19, 2009 at 8:34 pm

    If all else fails, you could always use multiple instances of your item, each with a different anchor point. 🙂 Granted, an expression would work better in the long run.

  • Griffin Englander

    May 18, 2017 at 5:41 am

    Firstly, everyone please forgive me for bumping such an old thread. But some wizardry on this would be amazing.

    Same as above at the core. I have a bunch of triangles rotating around the screen, each rotation is from a different edge of said triangle, so the anchor point has to move with it. The anchor point adjustment happens in the shape’s transform property, the rotation is on the layer’s property…

    I basically have a checkbox for each point it can be (1 of 3) and being in a static position works fine. The problem is keeping up with the new location after each rotation, if that makes any sense.

    Any help here would be great.

    Thanks!

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