I have a car rig using eRacoon’s Blendswap mesh. The rig is essentially the Blender Cookie simple car rig. The location of the bone is routed to the rotation of the wheels. This works fine in a straight line but when I put the car on a spiral path the wheel bone constraint logic no longer works.
Are there any rig masters out there that have a solution to this woeful problem?
To observe what I am talking about open up the attached BLEND file and press play. Sometimes the wheels spin forwards and sometimes they spin backwards. It depends upon where the Base bone is located at any given time.
The reason it doesn’t work is that method is based on a linear distance. When you follow a curve, its no longer the case.
There is one way where if you’re having a vehicle follow a path, you can divide the length of the path by the circumference of the wheels to calculate wheel rotations over the path distance. I animated wheels on a train using a driver I made based on this. However the plugin needed to calculate path length is one that doesn’t come with Blender. (Why? I have no idea. Honestly though, length really should be a built-in property associated with path objects.)
I remember downloading “get-path-length” plugin a while back, but I’d have to do some digging again to find it again.
Was playing around with car rigging a few month’s back. I think I have a rig that will work. Nothing fancy like springs and auto body roll, but a basic rig that would fit this style/work you have going on with this city generator.
No promises, but I’ll look into the work I have. I saw the work you’ve done with this generator, and thought it would be fun to try my car rig on…
I am experimenting with other ways to move the wheels using drivers. I can get distance or percent along path but I am not sure how to take into account wheel size or route the final data to quaternion rotation of a pose bone.
I have made several attempts to use this “transform constraint” to do rotations… it never works for me… same problem as your having there… one rotation and it goes all arigh some how… I avoid it’s use in all instances if I can… I always seem to be able to make do with Copy Rotation or Copy Transform constraints of jump right into drivers…
however…
after having looked at your file and tried to use drivers… I still get a back and forth result…
I am making some progress, thanks everyone. I have ditched quaternion in favor of euler and have basic rig working based upon distance traveled along a curve (Mackraken’s code from curve tools helps again!). I discarded the constraints as well using a driver to rotate the bones instead.
Basically I wanted to access the Curve Modifier… (not the curve constraint) so I built a edge only Arrow…“Road_Tracker”… gave it a curve modifier… animated it on the Y axis to match the car… (shouldn’t be to dificult to connect it to the Car Rig somehow)
then simply use a driver on the tire bones (at least the back ones) connected to the y location of the “Road_Tracker” object…
in the driver I used a simple expression… (3*varROT) you may have to change ‘3’ to something more accurate… but ‘3’ looked about right… also using a curve instead of an expresion here might work better…
Sorry, I’ve been absent… Took a look thru my files and I have a scripted wheel rotation solution, based on Roubaul’s 2.49 work. For some reason, it won’t work once the rig is on a curve. Works fine for key frame animation… If you want to see the file and scipt, I’ll send it to you.
Rotation based on curve length is the way to go on this. I’ll look at norvman’s file, and I have a few ideas as well…
Norvman, pi is that magic number you’re looking for. If you ever took trig in highschool, well, it’s finally good for something.
Old vid… Made before I knew there was a plugin (the one I mentioned earlier), however the idea works.
The first part will give an idea. The middle part is about an array I used to get the measurement. However since there’s a plugin to get the path length, you can skip the middle part for how I made the driver at about 4:16 or so into the video.
LOL! yep!.. I’m just lazy some days… and in the process of throwing something together I rarely stop to think in those terms… “eye balling it” and “holding my tonge just right”… LOL! … gets the job done on the first round… trying to get the over all Rigg working before I refine things out…
I was playing around with the plug in for getting the curv length the other day… revolt_randy was showing me that…
I did a quick discription in my post… and it’s really not a complete Rigg… that is the “Road Tracker” is really not combined into the Rigg like I would like… but it was an easy way to fix what the issue was… which was getting some kind of a length measurement that did not wave between positive and negitive numbers…
contact me if you have questions… I think after you look at it though it will be pretty obvious how it works…