Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects A Simple Motion Problem?

  • A Simple Motion Problem?

    Posted by Yuri Koehnlein on January 12, 2008 at 5:11 pm

    My After Effects CS3 seems to ignore the most basic rules of mathematics. I need to create a smooth motion of an object with 100px/s in a 25fps composition. It’s a linear motion without any variations. But somehow the calculation always gets wrong.

    Example:
    Setting up two position-keyframes with, let’s say, “3000” and “3016” and three frames in between always creates values like “3004,0002”, “3007,9996” or “3012,0008” instead of 3004, 3008 and 3012.

    Some rounding can’t be that hard. But even between two position-keyframes with “0” and “8” I always get something like “4,0006”. I just don’t get it

    Darby Edelen replied 18 years, 4 months ago 3 Members · 3 Replies
  • 3 Replies
  • Darby Edelen

    January 12, 2008 at 9:03 pm

    After Effects handles interpolating properties outside of a frame based structure internally, that is to say that there can be unique values at a subframe level. This may be what is causing your subtle ’rounding errors.’ If you need each element of the vector to be an integer at each frame try applying this expression to the position property:

    x = Math.floor(value[0]);
    y = Math.floor(value[1]);
    [x,y]

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

  • Sam Moulton

    January 12, 2008 at 9:21 pm

    I get accurate results. Pal square pixel comp, square pixel solid, starting position at 1 second is 100, 288. Set keytframe, then moved to 4 seconds and set position keyframe at 1000, 288.

    layer moves 900 pixels in x in 3 seconds or 300 pixels per second.

    Checking position at 2 seconds it’s exactly 200, 288.

    Change the comp to non square pixels and the results are the same.

    If you’ve got any easing applied or your keyframes don’t look like ◊ in the timeline then you won’t get exact numbers.

    If you motion isn’t just in x or just in y then you won’t get exact numbers either. If your movement must be exactly 300 pixels per second try adding this expression to the position.

    x = position[1] + (time * 300);
    y = position[0];
    [x, y]

    this moves 300 pixels per second from left to right. Want to move from right to left then change the + to a minus. Want to move up or down, change the y to x and the x to y, then change the zero to one and the one to zero.

    hope this helps….

  • Darby Edelen

    January 12, 2008 at 11:51 pm

    Here’s another question: how are you creating your position keyframes? If you drag the layer in the comp window then you can easily end up with position keyframes with subpixel values, if you want an exact integer you need to type it into the position property field.

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

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