global proc setkeys() { string $names[ ] =`ls -sl`; if ($names[0] != "RootControl") { string $name; for ($name in $names) { setKeyframe ($name + ".tx"); setKeyframe ($name + ".ty"); setKeyframe ($name + ".tz"); } } else { setKeyframe RootControl.ty; setKeyframe RootControl.tz; } } global proc displayFunc(int $dis) { int $dis; switch ($dis) { case 1: HideJoints; hide "*_stdin"; select -r skin; showHidden -a; select -d; break; case 2: hide Character_Skin; select -r "*_stdin"; showHidden -a; select -d; break; case 3: hide Character_Skin; hide "*_stdin"; ShowJoints; break; default: } } global proc SkeletonControls (){ window -title "Skeleton Controls" -widthHeight 450 450 SCcontrols; string $form = `formLayout`; //Interface text string $txt1 = `text -label "Right Arm Left Arm"`; string $txt2 = `text -label "Waist"`; string $txt3 = `text -label "Right Foot Left Foot"`; string $txt4 = `text -label "Display"`; //Create buttons // Right Arm string $b1 = `button -label "Arm" -command "select -r Arm_RCtrl r_Elbow_RCtrl"`; string $b2 = `button -label "Wrist" -command "select -r ForeArm_RCtrl"`; // Left Arm string $b3 = `button -label "Arm" -command "select -r l_Arm_LCtrl l_Elbow_LCtrl"`; string $b4 = `button -label "Wrist" -command "select -r l_ForeArm_LCtrl"`; // Waist string $b5 = `button -label "Waist" -command "select -r LowerBodyCtrl"`; // Right Foot string $b6 = `button -label "Foot" -command "select -r Mover_FootR"`; // Left Foot string $b7 = `button -label "Foot" -command "select -r Mover_FootL"`; //Display buttons string $b8 = `button -label "HiRes" -command "int $dis = 1;displayFunc($dis)"`; string $b9 = `button -label "LoRes" -command "int $dis = 2;displayFunc($dis)"`; string $b10 = `button -label "Joints" -command "int $dis = 3;displayFunc($dis)"`; //Keyframe button string $KEYframe = `symbolButton -image "setKey.xpm" -parent $form -command setkeys`; columnLayout; // Sliders for SpineCtrl floatSliderButtonGrp -label "Side" -field true -buttonLabel "Key" -buttonCommand "select -r SpineCtrl; setKeyframe SpineCtrl.Side" -minValue -20.0 -maxValue 20.0 -value 0.0 Side; connectControl Side SpineCtrl.Side; floatSliderButtonGrp -label "Twist" -field true -buttonLabel "Key" -buttonCommand "select -r SpineCtrl; setKeyframe SpineCtrl.Twist" -minValue -20.0 -maxValue 20.0 -value 0.0 Twist; connectControl Twist SpineCtrl.Twist; floatSliderButtonGrp -label "Bend" -field true -buttonLabel "Key" -buttonCommand "select -r SpineCtrl; setKeyframe SpineCtrl.Bend" -minValue -20.0 -maxValue 20.0 -value 0.0 Bend; connectControl Bend SpineCtrl.Bend; // Text layouts formLayout -edit -attachForm $txt1 "top" 80 -attachForm $txt1 "left" 100 -attachForm $txt2 "top" 160 -attachForm $txt2 "left" 100 -attachForm $txt3 "top" 220 -attachForm $txt3 "left" 100 -attachForm $txt4 "top" 280 -attachForm $txt4 "left" 100 $form; //Button layouts int $bOffsetW = 180; int $bOffsetH1 = 80; int $bOffsetH2 = 140; formLayout -edit -attachForm $b1 "top" 98 -attachForm $b1 "left" 80 -attachForm $b2 "top" 120 -attachForm $b2 "left" 80 $form; formLayout -edit -attachForm $b3 "top" 98 -attachForm $b3 "left" (80 + $bOffsetW) -attachForm $b4 "top" 120 -attachForm $b4 "left" (80 + $bOffsetW) $form; formLayout -edit -attachForm $b5 "top" (98 + $bOffsetH1) -attachForm $b5 "left" 80 $form; formLayout -edit -attachForm $b6 "top" (98 + $bOffsetH2) -attachForm $b6 "left" 80 $form; formLayout -edit -attachForm $b7 "top" (98 + $bOffsetH2) -attachForm $b7 "left" (80 + $bOffsetW) $form; formLayout -edit -attachForm $b8 "top" 305 -attachForm $b8 "left" 80 -attachForm $b9 "top" 305 -attachForm $b9 "left" 118 -attachForm $b10 "top" 305 -attachForm $b10 "left" 158 $form; formLayout -edit -attachForm $KEYframe "top" 170 -attachForm $KEYframe "left" 360 $form; showWindow SkeletonControls; }