Bone Chain Movement Via Spline IK

Howdy.

I’m updating my old PRR T1 rig to do additional renders, and I really hate the way I had previously set up the rail tracking. I thought there would be a better way to do it via spline IK but I’m having trouble making it work.

How it worked previously is that every rigid wheelbase on the locomotive has a bone, and an IK tracker at the tip of that wheelbase’s radius. Pilot truck at the front axle, engine bed at #1 driver, trailing truck at the rearmost point of the centering device radius, etc. These all had follow path/curve modifiers and thus followed the curvature of the track, and the mechanical rigs all point to their respective handles and functioned appropriately.

However, this is a real bastard to set up as with the follow path modifier these points are relative to both the length of the curve, the duration of the animation and all these bones relative offsets to their respective parents. Meaning all these offsets have to be painstakingly set up by hand, every single time, with a tolerance of at most half an inch. The offset keyframes then also have to be juggled manually if I wanted to alter the speed. This is just a real SOB and a big fat waste of my time.

I also tried “clamp to” for these IK handles, but these don’t inherit rotation of the parent curve which breaks all possible pose constraints and just generally doesn’t work at all.

However, Spline IK has since been added, and the solution seemed obvious. A continuous chain of bones representing each rigid wheelbase, parent the IK handles and root bones to each respective link, and move the chain down the curve, job done.

However, I can’t move the chain along the path. I know this is possible in 3ds/maya, I’ve done it since, but it isn’t happening here. The functionality is already there as the ‘chain offset’ checkbox will move the chain along the curve to match the ref pose, the ability to move it just seems arbitrarily locked off.

I thought maybe parenting it to another bone and moving it relative to the curve would force it to work, but it simply ignored the curve entirely.

Am I daft and this does work and I’m missing something, this seems to be a very self evident use case.

For a non-cyclic curve, you can move spline IK along the path. Put an extra, non-deforming parent at the root of the spline IK and include it in the chain length. Set its child to not inherit any scale. Use “bone original” scaling in the constraint. Then, to move the chain along the path, you simply scale this new parent:

I wouldn’t do clamp-to. There are things you can do to get rotation, but it’s not worth it. I’m not sure exactly what technique it uses to judge distance along curve, but it’s not the same as other things (like a curve modifier) so I don’t trust it and I don’t use it.

However, what I would probably do here (understanding that I don’t necessarily know all your needs or structures) is use a simple, non-rendering mesh with a curve modifier. Assign vertex groups to its vertices, then copy location, track VGs on the mesh with your “car” bones. Move the mesh in the curve axis, and the train follows. This makes it much easier to get your rotation values for the wheels, because the distance you move the mesh, in a single axis, divided by the circumference of the wheels, is how many times you have to rotate each wheel.

1 Like

The scaling idea was an interesting solution, but it appears to just jump the track. I’d still prefer being able to keyframe movement based on distance though, as I’d like to know exactly how fast it’s moving.

The vertex based solution is a bit rupe goldberg but it works for the rig quite well. I have a few issues to work out with the rig, but overall, it certainly does what i want. I wasn’t aware i could parent to individual verts/groups like that. Unless spline IK suddenly works as I’d hoped this is certainly what I’ll go with, thanks.

However there is the issue that this doesn’t inherit the tilt of the curve. This is a very mild issue comparatively, but high speed rail is slightly banked in corners and in a perfect world that would be automatically be handled, which the spline IK does actually do.

For all other purposes this is what i wanted but if anyone knows how to get Spline IK to behave I’d really appreciate it.

Not automatically, but it’s doable. So what you’re working with right now is probably just a long string of vertices, right? If you extrude vertices out, perpendicular to the curve axis, and mark those with new groups, you can locked track those vertex groups to acquire the tilt of the curve-modified mesh (which is probably just the tilt of the curve, although you can do some cool stuff by armature deforming before running it through the curve modifier-- sorry, that’s probably not relevant to you :stuck_out_tongue: )

That’s got it sorted. Thanks a bunch