Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression along elipse

  • Expression along elipse

    Posted by Glenn Tak on July 10, 2012 at 4:44 pm

    I have six objects I want to move along an Elliptical path. But they need to be in six different positions on the ellipse moving in syncronization. Imagine objects on a clock face at different times, slowly rotating around the face, (easy to do with nulls). But instead of a perfect circle I have the ellipse.

    I have created an Ellipse mask. Copied and pasted to the position of a null. Works great. Then I have duplicated that null 6 times, offset each null on the timeline so they are in the proper positions and then parented each object to one of the nulls.

    My question is… is there an easier way to do this with an expression to a) offset the null along the postition path and b) to slow down the move without having to stretch the key frames wayyyy off the timeline?

    Thanks

    ————

    Beef! Its what’s for Dinner

    Glenn Tak replied 13 years, 1 month ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    July 10, 2012 at 5:32 pm

    If the 6 objects are the first six layers in the layer stack, then something like this should work:

    p = thisComp.layer(“Null 1”).transform.position;
    numObjs = 6;
    timeDiv = 10;
    myOffset = (index-1)*2/numObjs;
    t = (time/timeDiv + myOffset)%2;
    p.valueAtTime(t);

    timeDiv is the slowness factor.

    Dan

  • Glenn Tak

    July 10, 2012 at 10:45 pm

    Thanks Dan

    The Time slowing factor works great but the offset doesn’t seem to be cutting it. Things are only slightly offset.

    I have 6 objects as the top six layers and my null. I understand all the expression except for the last two… particularly the use of %2… which doesn’t seem to do anything if I change the number.

    The last line is trying to offset the time (which it does) and the position (which it does but not at even intervals around the ellipse)

    There is also an issue with the mask spline direction I think. If I speed things up there comes a point were the object jumps back to the top of the spline. And the first object doesn’t even begin moving until about 20 frames in.

    I have a more keyframed solution to my animation needs but I sure would like to understand and make this work. I have a basic knowledge of expressions and have been reading a lot of online stuff but can’t seem to make heads or tails of this. Can you recommend any specific blog or site that will help me with this sort of 360° offset I am trying to achieve?

    Thanks

    TAK

    ————

    Beef! Its what’s for Dinner

  • Dan Ebberts

    July 10, 2012 at 10:51 pm

    I assumed that you pasted a closed elliptical path into the null’s position. That would give you a 360 degree cycle over a 2-second period. I also assumed that the null layer starts at time zero, and that you haven’t moved the the keyframes. Any or all of my assumptions could be wrong. 🙂

    Dan

  • Glenn Tak

    July 10, 2012 at 11:06 pm

    Ah haa! Alright… I did stretch out the keyframes on the null to cover the entire length of my 10 second composition. I guess that screwed it up.

    It seems to work as expected now.

    Is the %2 regarding the 2 seconds of Key frame time?

    Thanks… you saved me a lot of client change time.

    TAK

    ————

    Beef! Its what’s for Dinner

  • Dan Ebberts

    July 10, 2012 at 11:11 pm

    That’s correct. It just gives you the remainder of the total calculated time divided by 2.

    Dan

  • Glenn Tak

    July 11, 2012 at 12:46 am

    Thanks for your help Dan.

    TAK

    ————

    Beef! Its what’s for Dinner

  • Glenn Tak

    July 15, 2013 at 10:29 pm

    Dan

    I’m revisiting this project/problem for my client. We are now up to 9 objects spinning around the ellipse.

    I’ve noticed that at this number they don’t seem to be evenly spaced out and they clump up at various points along the ellipse. Is there something I need to change other than just the numObjs value?

    I’ve been playing around with the anchor point and each object seems to travel from point to point on the ellipse at the same speed.. Would a difference in scaling or size ratio effect the speed and cause them to bunch up? The objects have been scaled differently.

    Or is this just an inherent issue with the geometry of an ellipse?

    If you have any insight I would surely appreciate it.

    Thanks

    TAK

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