Wheel turning: must pass "U-turn test"

I’m trying to do this without adding a python script to the scene unless it’s contained in a driver.

Every Blender tutorial I’ve seen on wheel turning matching movement assumes the vehicle is going in a straight line on a single axis. Not a single one that I’ve found passes the “U-turn test”. ((driver object Location X) x (dimensions[2]) x pi x -1, or Transformation constraint for example, neither accommodates turns). A car should be able to make a lot of turns and still have the wheel turning and tracking the ground.

What happens in a U-turn is the wheel stops at the point the path reverses, then turns backwards.

Even making a distance variable in a driver with a non-moving reference object works in realtime as long as the vehicle is going in a straight line.

Using animation information seems to require a python script. Either to read animation curves, create a motion path and read it, or taking single frame translation deltas per frame using two objects (one delayed by a frame with say an Action constraint) to measure distance traveled in a single frame and add it to the distance traveled in the previous frame…requires a python script to create an array using frame numbers as an index and adding them all up (as an example).

I’m really trying to avoid another python script in the scene if possible. Can this be done with drivers (even with elaborate expressions), constraints and modifiers alone? Can Geometry Nodes capture location data over time and process it in a mathematical array? Or is this something only possible using a python script in Blender at this time?

Thanks for any suggestions or pointing me in a direction to solve this.

1 Like

You could try this one, a little complex but the result is good.

1 Like

Thank you, I got it and I understood how it worked immediately. It’s kind of the simplest possible solution with the main disadvantage happening when working on a production where they do the vehicle rigging and hire the animators later. I suspect animators would prefer to just move and rotate the vehicle around the scene with autokey.

1 Like

Why?

So @DNorman post references a Stack Exchange post by @batFINGER , and he really knew his stuff well. So I am sure batFINGER’s advice is spot on.

Another user who was good at this stuff was @clockmender - see here

clockmender went on to work with animation nodes (an add on not included with blender) and got some really amazing results with multi-axle vehicles. I don’t know if the animation nodes add on will work with current versions.

Blender at one point in time (v2.49) could handle this, it was called a ‘stride bone’. It was added in for making the first open movie ‘Elephants Dream’ and it was for animating a character walking along a bezier path. It would also handle rotating a bone as the bone moves along a path. Think vertical bone the size of the radius of the tire, move the bone along the path, and the bone rotated like a wheel. This feature was never added in when the blender 2.5x re-write took place.

I’ve thought for some time blender needs a ‘transform rotate’ constraint for this sort of issue. I’ve thought about writing up a proposal for such a thing and posting it too right click select but I think that site sees a ton of suggestions for features and isn’t taken seriously by the dev team.

My car rig uses a python script to bake the wheel rotation and will work on both curves (car rig master bone follows a curve) or keyframe animation (keyframe lot/rot of master bone).

Randy

1 Like

The stack exchange thread does not really talk about wheel rotation, it is more about moving bones along a curve in a snake like fashion, for trains, trailers to follow behind.

A side effect is that you can use the method to drive the wheel rotation as the drive control object only moves on one axis, and you can also use a bone to point the wheels into a turn.

I suspect that the python/animation nodes/baking solutions are the only way to get a “distance/speed I am traveling” value without a curve that fixes the trajectory.

Maybe it could be done with geometry nodes, I am not that good at vector math.

The animators I have seen (in videos, I am not a professional) all used curves to do cars.

These guys do a great rig with correct wheel rotation but I think they use curves too. (I have not used this addon but it looks good)

A game engine is a different matter, they do use the keyboard inputs to set acceleration and direction.

1 Like

It’s one thing when I’m in the same building with the people I work with, and another when we’re not only remote but the animators might not use the rig for weeks or months after I’ve moved on.

So making features dependent on a Python script adds a major point of failure. It means an animator brought in by someone I may never have had contact with, has to bring in a script or run it or enable running scripts.

The curve solution solves a problem but also is a “rigger telling animators how to work” thing. At least it’s simple. And about as standard as it gets in Blender I guess.

We need something like geo nodes for animation. Not like the kind of halfway add on from a few years back. But with full matrix access, indexed arrays, time base attributes, etc.

Gonna take a look at the Launch Control stuff later this week. Thanks for the suggestions!

Got a notification from this thread and couldn’t help but speaking into it, heheh.

Yes, Launch Control is indeed a spline based workflow. It’s not a simulated solution though, but an animation tool - By that I mean that it favours the animators creative judgement rather than relying on a full simulation. And for that reason you are not limited to “playing back forward” like with some simulated solutions for car motion.

The rig uses Ackermann steering so as long as the car is not upside down or on extreme slopes, the steering is correct. The rig is fully blender vanilla - the python add-on is just an interface for speeding up the workflow. Everything can be modified and altered without the python interface too.

2 Likes

:rofl:

Yes my example was like a go cart. I used it for a traction engine that rotates the axel. I even managed to get a differential value with extra perpendicular bones (not in the example file I linked).
You could adapt it to Ackermann.

Your Addon does look great!

1 Like

Quaternions are what will keep your wheels always running in the same direction. I’m assuming that you are trying to make a curve where all wheels rotate individually without slipping or have the need to fake using keyframe animation. Maya has a script for that called makeRoll that has some very complex math. Try researching about rolling sphere on a plane and you will find some university articles about it. I once looked for that and still didn’t solved in Blender. There isn’t many Blender tutorials teaching quaternions for that application or rolling sphere on plane.

If you solve rolling sphere on a plane, you will also solve rotation directions and speed for each wheel.

It’s this concept:

This makes me feel a bit silly, It has been a while since I tried doing this with the follow path constraint.
It does work.

Simply animating the offset and using that as a driver for the wheels rotation!
Here the wheels are parented to the plane, the plane follows the path, I animate the offset and use its value as a driver for the wheel rotation.

Wheels.blend (110.6 KB)

I made this in Blender 4.0 so you will need 3.6 up to open the file.

It does full circles no problem the wheels never stop or turn backwards (unless you stop and reverse.)

I still like the other method with the bones because you can point the front wheels into the curve and haul trailers etc but for simple animations this is fine.

1 Like

Still slipping and wheels inside the curve need to rotate slower. Usually CG artists fake it by rotating very fast so people won’t notice.

Yes a differential is a different discussion.

I did manage to get one working with the bone method.

I will try to do a simple file I can share if you are interested.

2 Likes

Thanks for joining the thread Dan. If I used Launch Control to make rigs for my freelance clients, would my clients animators be able to animate the rigs without also buying Launch Control?

It’s funny that you bring up Ackermann steering. As soon as you said that I immediately went to “And throw McPherson Strut, double wishbone with asymmetric camber, swing arm, multi-link, leaf spring, and solid rear axle suspensions into the mix. Then make them operate automatically on uneven ground with potholes. Then add differentials. And allow animator driven steering and wheel slippage for drifting and make sure the tires are flattened at the bottom.”

1 Like

No easy animation of balls for us Blender users.

Don’t bet on a script like “makeRoll” making wheels easier. If it uses quaternions, it might make constraining rotation to a single axis harder. In Maya, it would be pretty typical if trying to constrain to a single axis flipped the wheel 180 degrees on the y-axis (z-axis in Blender) when it rotated 180 degrees :grinning:

Heheh, this sounds pretty sweet thought! I was looking at your example file and it’s a very interesting approach. One of the things I struggle with, with the ackermann setup is that it required me to use the rear axle as the origin of the rig. Meaning, the rear axle would follow the path, not the front axle. To many users this was pretty confusing as it requires you to make turns less extreme.

Thanks for sharing the setup! :slight_smile:

1 Like

Thanks StephG!

Technically, yes - You can animate the armature without the add-on/Python interface, but if they want to use the physics (based on geometry nodes), they would have to dig a bit to find the objects they need to bake the cache on and so on. Likewise when they change the spline. There is a function in the add-on that takes care of “offseting” the animation whenever the spline length changes allowing you to extend the length of the path without having to move around keyframes. (This is a problem because the Blender always uses a relative offset on the paths and not a constant offset in - say - meters).

TLDR: Yes, but some things would be a bit annoying to update manually.

Heheh, We already consider Camber of the wheels and Castor of the front wheels when turning (It’s not 100% geometrically correct, but approximated based on the compression of the shocks and the steering and it is user adjustable). Solid rear axle is possible already. And we imitate McPherson Strut geometry in the upcoming version. - Anti-roll bars is also something we want to imitate, but we haven’t done that yet though. So hey, I am just have a great load of fun playing with cars - That’s about it, hehe.

There is also a feature for deforming the tires to the road surface, but it’s quite performance killing, hehe.

If the client has to do a bunch of stuff, it really won’t work for freelance. Bummer.

Looks like my plan to roll my own will still be the plan :slight_smile:

1 Like

Yea, I know that, but the two of us have discussed car rigging and python scripts for that purpose. He shared with me some python script for wheel rotation when I was working on updating someone else’s script for wheel rotation. Neither script worked correctly, and I guess I should mention why, so others don’t head down this path…

The scripts where triggered by frame change event and would attempt to calculate wheel rotation based upon previous frame location and current frame location of the wheel. Don’t try this at home, it won’t work.

Now, I initially questioned this

Because I haven’t seen a rig without a python script to embed controls into the 3d view in a very long time.

The car rig I worked on needs to know what surface the wheels should stick to, and what curve to follow. I have a python script that embeds all that into the UI and sets things with a couple of mouse clicks. Without that script, an animator would have to find the modifiers and constraints that control that. So that’s why

Is true, but it would be a lot of work. So why not just use the python scripts?

It’s a common thing for all rigs to have python scripts for UI

Randy

1 Like

Yes, I see :confused:
A shame, but that makes sense.