Rolling wheel pyConstraint..?

I imagine a constraint in which bone ‘B’ rotates x degrees on its Y axis for each 1 BU bone ‘A’ is translated +Y (and inversely, rotates -x degrees for each 1 BU translated -Y). This way, wheeled vehicles could be set up and animated purely with armatures. Is this feasible?

I, and I’m sure many other mathematically challenged animators, would be very grateful if any of the forum’s coders would be so kind as to help us out by spending a few minutes implementing something like this.

A quick update on this – the way to do this doesn’t use pyConstraints at all, but the new ‘Transformation’ constraint!

I guess this Transform constraint short tutorial (original in German) could help you with this problem?
http://translate.google.com/translate?u=http%3A%2F%2Fde.wikibooks.org%2Fwiki%2FBlender_Dokumentation%3A_Constraint%3A_Transformation&hl=cs&ie=UTF8&sl=de&tl=en

You can also do it with an Ipo driver

I once coded a pydriver that allows you to drive a cube using an empty. It works in both x and y directions. Note that the current version works properly only with full rotations in x and y. It seems just some simple extra logic (just check mod) for missing cases. You can find it at http://bebraw.googlepages.com/rollingcube5.blend .

You will notice that the rotations have been corrected using 5.74 as a correction factor. This is due to mismatch in the way IPOs and the Python API work. This is not a bug. (I reported it as one. :)) It’s more of a known limitation. Just keep this in mind when using rotation drivers.

Anyway coding a driver for wheels should be fairly trivial. Just refresh some elementary maths a bit and you should be fine.

<edit>
A couple of possibly useful reference implementations: http://blenderartists.org/forum/showthread.php?t=72162 , http://blenderartists.org/forum/showthread.php?t=85484 .
</edit>