Saturday, December 24, 2005

Spine Script Complete

I've completed my MEL script which automatically generates a stretchy spine. The procedure allows for three inputs, the root joint, the tip joint, and the number of bones to lay inbetween. This allows the script to target an existing FK spine and create the stretchy joint chain along it.

It does this by first creating a Spline IK system along the FK joint chain, then deleting the IK handle since we really only want the curve the Spline IK system creates. PointOnCurve nodes are then laid down evenly along the curve, their distance apart determined by a percentage (1.0 devided by the number of joints specified, to be exact).

Empty groups are then created, the PointOnCurve nodes' Position attribute is fed into the groups' Translate attribute. This positions the groups in world space, allowing us to Point Constrain joints to them. Aim Constraints are used to orient the joints towards the next node above it in the chain.

Lastly, the CVs are queried in the curve and each CV is assigned a Cluster. The Clusters make it possible to move the CVs without having to drop down into component mode. It also makes it possible to move the CVs with constraints by constraining to the Cluster, because its not possible to constrain directly to a CV.


Post a Comment

<< Home