Path Tracking Using Only Bones

Howdy. I’ve got a complicated train rig that i’d really like to simplify. Specifically the truck/car/etc tracking.


Currently i’m abusing the empty tracking from Turning_Wheels_Train from this thread

So for each body that needs to independently track the rails, an empty rides the rails curve at the end of the bone’s radius, and is offset by the right amount in it’s modifier, which the bone then tracks to.

But this sucks and i don’t like it for a bunch of reasons. The obvious being the rig is dependant on objects not contained within the rig itself, which is just liable to break and cause problems. Secondly, you have a string of fragile offsets. The main control bone is offset enough to accommodate the entire length of the loco on the curve, then every empty/bone has an offest from that to be positioned correctly, and the empty has an offset to match that so everything tracks correctly. This is a mess. Thirdly i have to bake this animation out through FBX, and the less arcane bullshit i have in the rig, the less likely it is to go wrong. Fourthly, if the rig has to go to outside dependancies, that’s just asking for it to break in new and interesting ways, particularly if the rig were to ever turn upside down. And beyond that this method is just horrible and janky as hell and i don’t like it on principal alone.

Is there a way to do this within bone constraints alone? Because i really don’t like the idea of the way this works and i’d really prefer a cleaner and entirely internal way of going about it.

Hi Steve,

I don’t know if you have seen this: https://blenderartists.org/forum/showthread.php?415251-My-Magnum-Opus-A-Train-No-Less!/page6 post #105. I have spent a sod of a lot of time trying to get a two-bogie carriage/loco to track around a curve properly, particularly needing all axles to stay where they belong when I edit the track curve. Edits, by the way have to be within reason of a realistic track, you cannot have an S bend in the length of the train for example!

I came to the conclusion that Follow Path will not work, because of mathematical inaccuracies and the fact that you cannot exactly determine where an object is on it in relation to another, the offsets will also fall apart if you move one curve vertex a tiny amount, since everything is based on the overall length of the curve. I was completely unable to rig a carriage/loco with everything entirely within an armature, because of one simple factor; cyclic dependancy loops, let alone the fact that bones cannot have curve mods! So I then decided to test the Curve Modifier approach rather than Follow Path, this gives one very good advantage - move two separated objects X along the curve and the separation stays constant. But there is a problem; the objects are NOT moving in World space, so if you measure their chord distance apart, you get the distance along the curve - this stops you from keeping the bogie centres at a constant distance apart on the curve. The objects are in fact moving in what I call “Curve Distorted World Space”, so the way to get around this is to parent objects to them and measure their separation distance - these new objects are moving in World Space, so this works. Then you need to offset the bogie centre from the curve as its position is fixed by the two outer axles being on the curve. I found a reliable way to do this that is described in the post I mentioned above, accuracy is very, very close to perfect.

Have look at my solution and let me know what you think, I can answer any questions you have on the way it is done. PM me if you like and we can swap email addresses, if you would like me to help in a less public way, this after all seems to be a minority rigging interest!

Cheers, Clock.

That’s loosely what i’ve done really, and again i don’t like it because it’s using outside dependencies. Which is really privy to break, supposing you were to flip it upside down, or do something else of the like.

Although that said, your solution kicks the shit out of mine. If you don’t mind me using that, it seems a lot more durable than what i did. Though i’m not sure how compatable it is with my loco out of the box. All it’s motion drivers are bound to the local Y movement of the root bone as (R2Pi (Meters) / Radian), and i’m not sure using your motion source would break that or not.

I’ll give it a go on the coach and see what happens, ta.

Of course you can use my solution - I hope it helps, I have never found a way to do this accurately within an armature - too many cyclic loops and no curve mod available…

If you need any more just let me know.

Cheers, Clock.