Here we are, part three, and progress is looking good. For this post, I’ll describe some of the processes I’m using to set up the spine and tail’s behavior. Read on!
For both the spine and tail, I used spline IK with the added ability to stretch. For those that don’t know, it’s possible to scale the joints in relation to the length of the spine curve used for the IK. Retrieving the length of the curve is made simple using Maya’s CurveInfo node. This little snippet of Python makes it all possible to get the length node:
maya.cmds.arclen( curve, constructionHistory=True )
With this node, it’s possible to scale the joints using a multiplyDivide node to normalize the new length versus the default. For example if the default length of the spine is 40 and the current pose stretches the curve to a length of 50, we would stretch, or scale, the joints to 1.25 to match the new length. In the case of the scorpion, I want to avoid scaling joints in order to keep the setup robust, so instead, I lengthen the joints through translation. The trade-off of using translation to lengthen joints opposed to scaling is that extreme stretches wont look as good. In the case of this rig, the stretchy behavior only exists to offer the animator some flexibility to achieve poses and make the controls more predictable, so the stretch shouldn’t be noticeable at all since it merely exists as a cheat. The other issue is that it complicates the multiplyDivide nodes slightly, since I now have to multiply our scale against the bone’s default translate. Going back to the previous example, if our new scale is 1.25 and the default position of the joint is 15 units ahead of its parent in the x-axis, we multiply 1.25 against the position to get our new translation 18.75 on the x-axis. The tail uses a similar setup to the spine, but also has an IK/FK switch for added versatility. The switch is achieved using a 3-bone setup; it’s a very standard approach and there’s plenty of tutorials that go at-length to describe the same process with eloquence. Including this one.
Deformation-wise, the inner cord that makes up the spine is smooth-bound to the skeleton. Constraints are computationally faster than skinning since the transformation is happening on an object level; with this in mind, the solid segments of armor along the spine and tail are constrained to the nearest joint. I didn’t do this with the Head in the previous chapter due to a brain-fart, so I will have to go back and change it sometime soon (yay!).