Monday, August 20, 2012
Plane Surface Driving Joints For Skinning Rig
Why use planes to drive bound skin joints? One reason is to eliminate need for math expression / complex nodes to maintain bound joint spacing because the plane helps keep the joints spacing. This is very helpful for skinning stretchy limbs.
What tools were helpful in making this? I made a tool to draw a plane given a chosen number of patches the main command used for that in MEL were
`nurbsPlane -p 0 0 0 -ax 1 0 0 -w 1 -lr 5 -d 3 -u 1 -v $numberInteriorJointsPlusTwo -ch 0`;
and for fixing some of the cvs of the plane (here does some removal of u direction cv's)
rebuildSurface -ch 0 -rpo 1 -rt 0 -end 1 -kr 0 -kcp 0 -kc 0 -su 1 -du 1 -sv 3 -dv 3 -tol 3.93701e-05 -fr 0 -dir 0 $plane; .
The other tool that was helpful was to parent joint to follicle. (by making hair by output curves I could write script that expected a joint then a hair curve selected and it figured out which follicle to parent joint to). Some MEL commands used for this one were
`listRelatives -children -type nurbsCurve $curve`; //look in the hierarchy of curve but don't go any further down in the hierarchy, then tell me what are all the things there that are nurbsCurve.
`listConnections -type follicle $curveShape`; //give me all the things on the scene that are follicles and are connnected somehow to this shape node.
and this one
eval("listRelatives -children -type pfxHair `listConnections "+$hairShape+"`"); //look in all the things connected to my shape, go into each one's hierarchy one level down, and give me back anything of type pfxHair.
A slight note about this pretty cool huh. Well we can nest calls in MEL. Its kind of like order of operations in algebra, but here it does the innermost ` ` first. I think it works for at most 1 level (that is I don't think eval( "f ` `z` `" ) can work but eval("f `z`") would. Also i'm not sure whether there are restrictions for the f and z. I usually use `select -r` for f, and `ls -sl -type` for z. )
Inspired by Aaron Holly ( http://forums.cgsociety.org/archive/index.php/t-321243.html ) , (http://nz.linkedin.com/pub/aaron-holly/1/47a/673), Jose Martin (joseantoniomartinmartin dot com) and David Suroviec (davipalooza dot blogspot dot com).