3
$\begingroup$

I have spinning wheel with 2 keyframes (from 0 to 120 degree). Its rotation is constant (linear interpolation) and it is looped using f-modifier so it look like endless animation. Now, I want this wheel to accelerate speed smoothly from lets say 0 to maximum speed and stay on this for the rest of animation. How can i achieve that? I could rotate wheel many times and edit its curve in Graph Editor but it's sound stupid and also can't be used for linear movement.

$\endgroup$

1 Answer 1

3
$\begingroup$

Driver solution

Looking at the equations for Uniform Acceleration in the wiki, and assuming we start with zero velocity and displacement. The frame number is our time part, convered using fps to seconds, which will make it far easier to visualise.

frame = scene.frame_current
fps = 24
v = 1.0
a = 3.0
t = frame / fps

s = min(v, a * t / 2) * t

Calculated velocity will accelerate at a until it reaches velocity v. The displacement s is the calculated velocity times how many seconds t.

Setting up a driver expression

A simple case where fps is hard-coded as 24 ( 24 squared is 576), our maximum velocity is 1.0 blender units per second, and our acceleration is 3.0 blender units per second squared.

min(1.0 , (0.5 * 3.0 * frame / 24 )) * frame / 24

Upon re-reading your q, noticed I'd used location as an example, whereas you were asking about rotation. The same concept works for rotation as every revolution will travel 2*Pi*r where r is the radius. Change the equations accordingly for revolutions per second.

The scripted expression can be pasted directly into a property (appending a # to start tells blender it's a driver) which on which should turn purple. [Editors find me a link]

This can be applied to x, y, z locations and having a terminal velocity of (vx, vy, vz) and acceleration of (ax, ay, az), and use the values in the relevant driver.

To further the approach a custom property for v and a could be added to the driven object, and variables used to put that value into the expression.

Note the fps from the render settings could also be used a var in a driver to make it changing render fps proof.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .