Friday, October 10, 2014

Some Selection tips using MEL in Maya


Here are a couple of tips i wrote for selecting objects of a certain type for viewing in Maya.

The first tip is
, it is incredibly helpful to make a simpler scene to work on by just seeing what we wish to .

These two are helpful for adding something or removing something from the isolated viewed thing.
isolateSelect -addSelected modelPanel4;
isolateSelect -removeSelected modelPanel4;

This tip helps with selecting all things from a hierarchy, like say select all cluster handles, or joints (just change -type "clusterHandle" to -type "joint")

global proc na_selClusterHInHierarchyFromSelectedRoot(){
//---select all joints in hierarchy of selected root
string $sel[] = `ls -sl`;
if(size($sel) == 1){
 select -hierarchy; select -r `ls -sl -type clusterHandle`;
warning("Treating Each thing selected as a Root !!!\n");
//error("Requires a single selected root !!!\n");
string $addToSel[] = {};
for($arg in $sel){
 select -r $arg;
 select -hierarchy; select -r `ls -sl -type clusterHandle`;
 $addToSel = stringArrayCatenate($addToSel, `ls -sl`);
 select -cl;
$addToSel = stringArrayRemoveDuplicates($addToSel);
select -r $addToSel;


On the side im finding it helpful to preview mocap animation by using a linear curve that follows the leg or arm (where cvs are clustered and parented to the mocap rig).  By doing this it is easier to see frames we wish to use from mocap animation.
Also im finding using iksc handles helps to get translate based mocap animation to give joints rotation values.  Check out my Mel tips for rigging on vimeo for some insight into geo adding to joint tools and segment tools, this will come in very handy for getting a quick proxy geo view of mocap data.