Using pydriver for wheel rotation along path

I did not find any previous examples of doing this so here is my solution:
When the length of the path curve (actual length, not path length) and radius of the wheel are known, the rotation can be calculated based on Speed-curve that controls the vehicle motion.



NOTE: You must enable script links in order activate the pydriver.

Here is the expression:

b.Ipo.Get("ppspeed").getCurve("Speed").evaluate(b. Get("curframe")) * (79.7/21.1) * (-36)

  1. "ppspeed" is the name of the speed IPO curve.
  2. 79.7 is the lenght of the path
  3. 21.1 is the perimeter of the wheel.

The length of the path can be found by pressing PrintLen button (make sure that CurvePath is active):


The perimeter of the wheel you have to calculate yourself :)


PS. I did not quite understand the logic of the rotation handling of this driver. Rotations are n * 10 degrees, so if I want to rotate object 90 degrees, the script must output 9. Thas why there is mysterious 36 in the expression above.