As I create more rigs, I continue to look for more things to automate. I've come up with a new script that creates cluster handles for selected control vertices. I use cluster handles to control the deformations in a spline IK curve for spines or what have you. It was irritating having to select the curve, convert to CV selection, select the CV, create the deformer, and repeat. With this script, you can simply select all of the CV's, and run the script. It will create a cluster handle for each CV and set them to relative, so the curve does not receive double translations when parented in the rig hierarchy. It is a relatively short script so I will post it here in the blog:
//Catches CV's in a selection and creates a cluster deformer for each CV
ls -sl;
string $cjCVArray [] = `filterExpand -sm 28`;
for ($each in $cjCVArray) {
select $each;
newCluster " -relative -envelope 1";
select -cl;
}
I would also like to note that I have finished my FK control creation tool, and will post it as soon as I can find a way to host files for the blog.
Edit: So it was brought to my attention that Maya already has this function built into its menus... The good thing about this script, however, is that it taught me how Maya can use filters to get an array of selected components. Without the filter, your receive an array inside your array, which is pretty useless for what this script does. Basically, if you select CV's and run the script without a filter you get curve1.cv[0:4] instead of a list of each CV. Good practice.
No comments:
Post a Comment