// propScale // UI for scaling a series of clusters proportionally proc EJL_propScale() { string $sel[] = `ls -sl`; string $x; float $text; // create a prompt dialog to request the users name string $result = `promptDialog -title "Proportional Scale Window" -message "Scale by this amount proportionally:" //-button "Get name of object" //-command "getName" -button "OK" -button "Cancel" -defaultButton "OK" -cancelButton "Cancel" -dismissString "Cancel"`; // if OK pressed if ($result == "OK") { // query the entry typed by the user $text = `promptDialog -query -text`; print("User has entered "+ $text +"\n"); } else { error("User abort\n"); } //if (!`objExists "helloWorld"`) //{ //group -empty -n helloWorld; //} int $cSize = size($sel); float $counter = 0; for ($x in $sel) { float $cScale = ( $text / $cSize ); $counter = ( $counter + $cScale ); float $propSX = `getAttr ( $x + ".scaleX" )`; float $propSY = `getAttr ( $x + ".scaleY" )`; float $propSZ = `getAttr ( $x + ".scaleZ" )`; //print "\n"; //print $propSX; print "\n"; //print $propSY; print "\n"; //print $propSZ; print "\n"; //print $x; print "\n"; //select -r $x; //setAttr ( $dup[0] + ".translateX" ) (getAttr ($e + ".translateX")) ; setAttr ( $x + ".scaleX" ) ( $propSX + $counter ); setAttr ( $x + ".scaleY" ) ( $propSY + $counter ); setAttr ( $x + ".scaleZ" ) ( $propSZ + $counter ); //float $newScaleX = ( $propSX + $cScale ); //float $newScaleY = ( $propSY + $cScale ); //float $newScaleZ = ( $propSZ + $cScale ); //setAttr helloWorld.scaleX $newScaleX; //setAttr helloWorld.scaleY $newScaleY; //setAttr helloWorld.scaleZ $newScaleZ; } //delete helloWorld; }