Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Auto-Orient along Path Not Working with Expression Delay

  • Auto-Orient along Path Not Working with Expression Delay

    Posted by Kevin C. burke on December 24, 2014 at 8:48 am

    Hi,
    I have a scenario where I have two layers animating in a 3D circle. The leader has the position keyframes and the follower is delayed using valueAtTime. I have Auto-Orient ‘Orient along Path’ turned on for the leader but not the follower. For the follower, I am using the following expression in its Orientation property (see expression, below).

    It works well except for at the beginning and end when the position property of the Leader and Follower are equal. When they are, it snaps from path orientation to 0°,0°,0° (see image, below). The same thing happens if I use Auto-Orient ‘Orient along Path’ with the Follower. Can anyone please help?

    var leaderLayer = thisComp.layer("Leader Layer");
    var overlapTime = thisComp.frameDuration;
    p0 = position;
    p1 = leaderLayer.transform.position.valueAtTime(time+overlapTime);
    lookAt(p0,p1);

    Dan Ebberts replied 11 years, 7 months ago 2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    December 24, 2014 at 5:47 pm

    I’d try something like this:

    L = thisComp.layer(“Leader Layer”);
    lookAt(position,L.toWorld([L.width/2,L.height/2,1],time-thisComp.frameDuration));

    Dan

  • Kevin C. burke

    December 24, 2014 at 8:42 pm

    Hi Dan, thank you VERY much for the response. It’s not flipping, but now there is an odd rotation:

    These are the transform properties for both layers:

  • Dan Ebberts

    December 24, 2014 at 8:46 pm

    Do you have auto-orient turned on for that layer?

    Dan

  • Kevin C. burke

    December 24, 2014 at 8:50 pm

    I just double-checked and I do not. Auto-Orient ‘Orient Along Path’ is only turned on for the Leader layer.

    Here’s a screenshot of my transform properties:

  • Kevin C. burke

    December 24, 2014 at 8:54 pm

    And this is my project file:
    8328_autoorient.aep.zip

  • Dan Ebberts

    December 24, 2014 at 9:07 pm

    Ah, shape layers. Try it this way:

    L = thisComp.layer(“Leader Layer”);
    lookAt(position,L.toWorld([L.anchorPoint[0],L.anchorPoint[1],1],time-thisComp.frameDuration));

  • Kevin C. burke

    December 24, 2014 at 9:11 pm

    Dan, thank you so much! Your help to the AE community is invaluable. I sent you a tip through Motionscript. Merry Christmas and thanks again!

  • Dan Ebberts

    December 24, 2014 at 9:30 pm

    Happy to help–thanks for the tip!

    Dan

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