////////////////////////////////////////////////////////////////////// // selJointType.mel // // Oct 25, 2005 // Sean Nolan // sean@snolan.net // // Script that will pick only the joints and transforms(groups)with the prefix you make. // It will do a wild card search for only the joints and transforms you want // and give you the option for creating a selection set based off of the selection. // ////////////////////////////////////////////////////////////////////// global proc selJointType() { if(`window -exists selJointTypeWin`) deleteUI selJointTypeWin; int $winH = 135; int $winW = 250; window -t "Select Joint by Name" -wh $winW $winH selJointTypeWin; columnLayout -adj true; text -l "Enter Joint prefix:" -align "left"; textField txtPrefixName; text -l "Selection Set Name:" -align "left"; textField txtSelName; button -l "Grab'em and Make a set" -command "grabJointNames"; window -e -wh $winW $winH selJointTypeWin; showWindow selJointTypeWin; } global proc grabJointNames() { string $jointSearch = `textField -q -tx txtPrefixName`; string $setName = `textField -q -tx txtSelName`; select -r `ls -type joint ($jointSearch + "*")`; select -add `ls -type transform ($jointSearch + "*")`; string $buffer[] =`ls -sl`; string $joints[]; int $i; //-------------------------------------- // Create set based off of new selection //-------------------------------------- if($setName != "") { for($i = 0 ; $i < `size($buffer)`; $i++) { string $objType = `objectType $buffer[$i]`; if($objType == "orientConstraint" || $objType == "pointConstraint" || $objType == "scaleConstraint") { select -d $buffer[$i] ; } } string $joints[] =`ls -sl`; sets -n $setName $joints; } //-------------------------------------- // No set needed //-------------------------------------- else { for($i = 0 ; $i < `size($buffer)`; $i++) { string $objType = `objectType $buffer[$i]`; if($objType == "orientConstraint" || $objType == "pointConstraint") { select -d $buffer[$i] ; } } } }