Monday, August 20, 2012

Plane Surface Driving Joints For Skinning Rig

Some techniques I was inspired to try out that are beginning to work pretty well are using planes to drive bound skin joints.  Currently i'm using Maya hair but there are lots of options to get things moving with a surface see a wonderful overview at Matt Estela's cool website he offers lots of marvelous information about rigging (tokeru dot com).

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[0]; . 

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.
and
`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[0]+"`"); //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.  )


Cheers,
Nate


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).