How to get constant speed along f-Curve when animating with bezier curves?

I can’t discover how to get an object to animate at constant speed along an f-Curve when the interpolation mode is set to Bezier.

I created this simple situation. A cube animated using four keyframes evenly spaced in time and space. They form a diamond shape. I set the extrapolation mode to linear so the animation wraps nicely. I had hoped that this would create a circular motion path, which it almost did. I am able to fix the shape of the path by adjusting the bezier handles in the Graph Editor. You can see in the picture that I have done this for one point.

The problem is that the animation slows down through the keyframes and speeds up between the keyframes. You can see this on the attached motion path. The dots (keyframes) are closer together near the keyframes and further apart between the keyframes. Is there a way to fix the timing along the curve so the dots are all equally spaced?

Thanks for taking the time to look at my problem.


Point A to point B keyframed on location is exactly that, not circular. The curves adjust the timeing of ease in and out. You simply spaced a coordinate point on location when you adjusted the f curves and made more keyframes in a different place as far as the graph. You still are from point A to point B. If you want a circle, think turn, rotation etc. For example put an empty at your circle origin, parent the cube to the empty and keyframe the “rotation” of the empty four times for example. You can now set your linear interpretation on rotation.

To have constant speed you have to keep the curves on linear. The f-curves shouldn’t be used to control the way the object moves, only the speed of the object.

To have a cube (like in the example) moving in a perfect circular way, use a BezierCircle as a path for the cube. Then select the cube, then the BezierCircle and hit Ctrl+P. From the options choose Follow Path.

In answer to your question: “Not that I am aware of” - since that would mean messing with the laws of maths dating back to Isaac Newton’s time!

So the problem is that your object is moving in uniform time along a straight line drawn between each corner of your diamond shape (that is how you key framed it). The handles of the Bezier are warping the object away from the straight line so you get a circle, or near circle. This means that the object must accelerate as it moves further away from the theoretical diamond shape, as it is moving around the arc, at a uniform speed along the chord of the arc not the arc itself - have I lost you yet? No - Good. So to arrive at the end point having travelled in uniform time along the theoretical straight line at constant speed, it must accelerate and decelerate around the curve. So what you are trying to do is mathematically impossible.

So that gets to the question of:

Why do you want to animate a cube moving around a circular path by using four keyframes in a diamond pattern and strained Bezier interpolations to try to arrive at a uniform circular path?

And the subsequent riders to the question would be:

When you can simply animate the object around a circular path by parenting it to an empty at the centre of rotation and then key framing some rotations of that empty…

Or the alternative rider would be:

When you can animate the object around a Bezier circle using either a Curve Modifier or preferably a Follow Path constraint, if you don’t want to distort the cube…

Now if you have a valid reason that I am not aware of for doing what you are doing - you need to let me know it so I don’t look like a “Dick-head” here. If you just want to animate a cube around a fixed point in a circular motion at uniform speed, there are many easy ways to do that. Not least of which would be to use a driver for it’s Z location based upon the Cosine of some objects rotation or a frame based expression, and a similar X location based upon the Sine of the same object or frame based expression. I will explain:

If you add drivers to both the X and Z locations of an object and then set the X location driver’s scripted expression to be something like sin((frame - 1) / 10) and the Z location to be cos((frame - 1) / 10) and then press Play - the cube will trace a perfectly circular path without rotating itself, thus proving Newton to be correct! Trust me I know about Maths… BTW you need to check “Auto-run Python Scripts” in User Prefs > File Tab or scripted driver expressions do not work. Having got the cube rotating in a circular path at a uniform speed, if you were to plot its speed along the chords (straight lines) of your diamond you would find that it now accelerates and decelerates along those lines, again proving Newton and I correct in our understanding of Maths. In other words, you can not have an object travelling uniformly along a arc and the chord of that arc simultaneously - it must be one or the other.

This is not the only, or the easiest way, to animate an object around a circular path so that it does not rotate itself, but to mathematicians, it is the most intellectually satisfying. The easiest way is to parent it to an empty at the centre of rotation, keyframe rotations of that and then add a driver to the object so it rotates the opposite way to the empty - net result - it appears not to rotate itself, but will orbit around the empty.

If you are not totally confused, please let me know and I will try harder, if you are, let me know and I will try to explain it in simpler terms.

At the end of this great long reply I am now pressing the “Post Quick Reply” button - now there is irony for you!

Cheers, Clock. :smiley:

PS I am sorry to say that at times I have a somewhat odd sense of humour, as can be found in some of my other posts…

PPS. Isaac Newton discovered the Maths behind defining a curve or circle as the integration of a series of known cartesian locations - What you and I did at school and was called Calculus - Newton wrote his greatest work on mathematics in Latin - hence Calculus.

Thanks for the responses. I am surprised to hear that if keyframes are smoothly interpolated then there is no way to keep the speed constant (short of creating a path and constraining an object to follow it). I am actually trying to create a treading water animation for a character. I started by creating four keyframes for the foot in a circle but noticed that the speed was not even, the foot speeds up and slows down several times through the motion. Using the follow path approach feels heavy handed for animating character motions. I could reduce the effect by adding more keyframes, but I am worried that this will be a difficult solution to maintain long term. Is there a better way?

Well now that we know what you need, I think you should follow Clocks advise. Assuming you have an IK leg in your rig, simply set up the following. You may need a switchable parent on your IK target bone. But add a Bezier circle below your leg. Add a bone to follow the Bezier circle with a follow path constraint on it. It goes around the circle. You can key frame the animation and influence as needed. Add a child of constraint to your IK leg target bone making the bone that follows the path it’s parent while you need the animation. You key that influence to start when you want. When your done with the water treading, you simply key the influences back how you started. Shouldn’t take you any more than a couple of minute to set and a few more to figure out the rig modifications. Your leg will follow around in a circle from the end of your IK bone, assuming it is a person, the hip. This way you can also move the target bone up and down like a foot would when treading water. Hope it helps and gives you a few more ideas.

Thanks for the suggestions. People are very generous with their advice. It always exceeds my expectations.
:eyebrowlift:

Hmmm, this is nothing to do with Blender, but is down to pure Maths/Physics. Bezier curve definitions are based upon higher orders of maths than simple linear equations, therefore they absolutely cannot result in linear speeds of objects being affected by them, if that object is key framed along a series of straight line vectors! Unless, of course, the Bezier curve happens to be a circle, in which case it is not really a Bezier curve anyway. A circle is defined as “The locus of a point whose distance from a second point is constant”, therefore you can assume that anything travelling around it will not be accelerating in a radial fashion since it’s distance from the centre point remains constant. It is however accelerating in a vectored sense - hence centrifugal force based machines such as spin driers still work. A Complete lack of radial acceleration is what you are trying to achieve, believe it or not and is best done by using one of the methods I outlined previously.

However, if an object is travelling along an exponential or other higher order curve, the same does not apply since the curve is used to smooth out its transition from one vector to the next of its travel, It therefore follows that if it is travelling at uniform speed from one end to the other in a straight theoretical line or series of lines and is deflected by the curve, it must accelerate and decelerate along the curve.

Quod erat demonstrandum!

You might be best just doing what @stilltrying suggested.

Cheers, Clock.

Using sin(frame) and cos(frame) like clockmender said is the smartest option, however for flexibility I would recommend using a copy location constraint on a rotating empty (or @stilltrying’s solution above).

Have you tried making the f-curves cyclic?