//===================================================================== // SCRIPT: drago_copyAttrUI // AUTHOR: Drago Avdalovic // DATE: Dec 3, 2005 // PROCEDURE: drago_copyAttrUI (global) // ARGUEMENTS: none // RETURN: none // DESCRIPTION: This script can be used to copy attributes with the option for mirroring attributes //--- on diferent axis. //--- At least 2 objects needs to be selected in order to work. //--- First object selected is the one that passes attributess to the others. //====================================================================== global proc whatIsSelected() { string $sel[]=`ls -sl`; //--- make variables to store the value of the check boxes int $all_t =`checkBoxGrp -q -value1 traAxesAll`; int $t_x=`checkBoxGrp -q -value1 traAxesXYZ`; int $t_y=`checkBoxGrp -q -value2 traAxesXYZ`; int $t_z=`checkBoxGrp -q -value3 traAxesXYZ`; int $all_r =`checkBoxGrp -q -value1 rotAxesAll`; int $r_x=`checkBoxGrp -q -value1 rotAxesXYZ`; int $r_y=`checkBoxGrp -q -value2 rotAxesXYZ`; int $r_z=`checkBoxGrp -q -value3 rotAxesXYZ`; int $all_s =`checkBoxGrp -q -value1 scaAxesAll`; int $s_x=`checkBoxGrp -q -value1 scaAxesXYZ`; int $s_y=`checkBoxGrp -q -value2 scaAxesXYZ`; int $s_z=`checkBoxGrp -q -value3 scaAxesXYZ`; if (size($sel)<2) warning "You need to select at least 2 objects!"; else { //----------check for translate,rotate,scale checkbox selection------------------------ //---------- if selected sets the value of each x,y,z (translate, rotate and scale) to 1 if ($all_t) { $t_x =1; $t_y =1; $t_z =1; } if ($all_r) { $r_x=1; $r_y=1; $r_z=1; } if ($all_s) { $s_x=1; $s_y=1; $s_z=1; } //---- put result check box variables into an array int $info[]={$t_x, $t_y, $t_z, $r_x, $r_y, $r_z, $s_x, $s_y, $s_z }; //----- new array with names to be tokinized in loop string $infoNames[] = stringToStringArray ("t_x t_y t_z r_x r_y r_z s_x s_y s_z", " "); //----- $mirror checks the value of the mirror checkbox //---- $resultMenu checks what is selected in the menu string $resultMenu= `optionMenu -q -value mirrorBoxMenu`; //----- loop and if statement checks what is selected for ($i=0; $i< size($info); $i++) { if ($info[$i]) { //---- $resultMenu checks what is selected in the menu string $resultMenu= `optionMenu -q -value mirrorBoxMenu`; switch($resultMenu) { case "None": string $tok[]; tokenize $infoNames[$i] "_" $tok; string $transTok=$tok[0]; string $axisTok=$tok[1]; float $first=`getAttr ($sel[0] + "." + $transTok + $axisTok)`; for ($n=1; $n