/*Quick Select Set Manager Based upon NolanSW (on CG Society)'s script quickSetPicker Cannibalized and Regurgitated by Tony Sladky (email asladky@c.ringling.edu) Jane Kang (email jkang@c.ringling.edu) Matthew "Ozzy" Oztalay (highend3d ozzmeister00 | moztalay@c.ringling.edu) v1.0 The Quick Select Set Manager is a user interface that helps the user manager their quick select sets. The QSSM allows the user to create, delete, and focus on selected sets. The QSSM also has built-in functionality to assign a quick select set to a hot key (Shift+1 through 0) using the buttons in the User Interface. Known Issues: **Cannot use hotkeys if the QSS Manager window is not open Questions/Comments/Concerns/Suggested Features? Email one of the authors. */ //Upon start up, checks to see if the window already exists, and restarts the window proc createQSSMWindow(){ //If the window exists, delete the winow if(`window -exists quickSetManager`) deleteUI quickSetManager; window -t "Quick Selection Manager" quickSetManager; ////Necessary Variables string $form = `formLayout`; string $setList = `textScrollList -allowMultiSelection 1 -deleteKeyCommand "deleteItem" -selectCommand "pickList" -width 225 -height 300 quickList`; string $close = `button -l "Close" -w 65 -command "deleteUI quickSetManager"`; string $addSet = `button -l "Create Set" -w 80 -command "CreateQuickSelectSet; updateList" addSetButt`; string $deleteSet = `button -l "Delete Set" -w 80 -command "deleteItem; updateList" delSetButt`; string $focusOnSet= `button -l "Focus On Set" -w 80 - command "focusOnSelected" focSetbutt`; string $hotkeyLabel= `text -label "Selection Hot Keys"`; string $hotKey1Button= `button -l "[Shift]+1" -c "hotkey1"`; string $hotKey2Button= `button -l "[Shift]+2" -c "hotkey2"`; string $hotKey3Button= `button -l "[Shift]+3" -c "hotkey3"`; string $hotKey4Button= `button -l "[Shift]+4" -c "hotkey4"`; string $hotKey5Button= `button -l "[Shift]+5" -c "hotkey5"`; string $hotKey6Button= `button -l "[Shift]+6" -c "hotkey6"`; string $hotKey7Button= `button -l "[Shift]+7" -c "hotkey7"`; string $hotKey8Button= `button -l "[Shift]+8" -c "hotkey8"`; string $hotKey9Button= `button -l "[Shift]+9" -c "hotkey9"`; string $hotKey0Button= `button -l "[Shift]+0" -c "hotkey0"`; updateList; ////Layout information for the window formLayout -e -af $close "left" 230 -af $close "top" 300 -af $setList "left" 0 -af $setList "top" 0 -af $focusOnSet "left" 230 -af $focusOnSet "top" 55 -af $addSet "left" 230 -af $addSet "top" 5 -af $deleteSet "left" 230 -af $deleteSet "top" 30 -af $hotkeyLabel "left" 230 -af $hotkeyLabel "top" 100 -af $hotKey1Button "left" 230 -af $hotKey1Button "top" 125 -af $hotKey2Button "left" 230 -af $hotKey2Button "top" 150 -af $hotKey3Button "left" 230 -af $hotKey3Button "top" 175 -af $hotKey4Button "left" 230 -af $hotKey4Button "top" 200 -af $hotKey5Button "left" 230 -af $hotKey5Button "top" 225 -af $hotKey6Button "left" 285 -af $hotKey6Button "top" 125 -af $hotKey7Button "left" 285 -af $hotKey7Button "top" 150 -af $hotKey8Button "left" 285 -af $hotKey8Button "top" 175 -af $hotKey9Button "left" 285 -af $hotKey9Button "top" 200 -af $hotKey0Button "left" 285 -af $hotKey0Button "top" 225 $form ; showWindow quickSetManager; } //Process for deleting the selected set proc deleteItem(){ delete `textScrollList -q - selectItem quickList`; } //The select command for the text scroll coarsenSubdivSelectionList, quickList proc pickList(){ string $getListName[] = `textScrollList -q -selectItem quickList`; select -r $getListName[0]; } //Process for updating quickList when a new set is created or deleted. proc updateList(){ //Array that contains all sets in the current file string $sets[] = `listSets -allSets`; int $i; //removes all the items from the text scroll list textScrollList -edit -e -removeAll quickList; //repopulates quickList with all current sets for($i = 2; $i < `size($sets)`;$i++){ textScrollList -e -append $sets[$i] quickList; } } //Process for focusing on the selected set in all panels proc focusOnSelected(){ string $mps[] = `getPanel -type "modelPanel"`; string $mp; string $c; for ($mp in $mps){ $c = `modelEditor -q -camera $mp`; if ($c != ""){ viewLookAt $c; } } } //the processes for getting and assigning each hot key proc hotkey1(){ //selects the contents of the set nameCommand -ann "hotkey1" -c "ls -sl;" hotkey1NamedCommand; //and assigns the selection of those components to a hot key hotkey -k "!" -name "hotkey1NamedCommand"; print ("The selected objects have been assigned to hot key 1" + "\n"); } proc hotkey2(){ nameCommand -ann "hotkey2" -c "pickList" hotkey2NamedCommand; hotkey -k "@" -name "hotkey2NamedCommand"; print ("The selected objects have been assigned to hot key 2" + "\n"); } proc hotkey3(){ nameCommand -ann "hotkey3" -c "pickList" hotkey3NamedCommand; hotkey -k "#" -name "hotkey1NamedCommand"; print ("The selected objects have been assigned to hot key 3" + "\n"); } proc hotkey4(){ nameCommand -ann "hotkey4" -c "pickList" hotkey4NamedCommand; hotkey -k "$" -name "hotkey4NamedCommand"; print ("The selected objects have been assigned to hot key 4" + "\n"); } proc hotkey5(){ nameCommand -ann "hotkey5" -c "pickList" hotkey5NamedCommand; hotkey -k "%" -name "hotkey5NamedCommand"; print ("The selected objects have been assigned to hot key 5" + "\n"); } proc hotkey6(){ nameCommand -ann "hotkey6" -c "pickList" hotkey6NamedCommand; hotkey -k "^" -name "hotkey6NamedCommand"; print ("The selected objects have been assigned to hot key 6" + "\n"); } proc hotkey7(){ nameCommand -ann "hotkey7" -c "pickList" hotkey7NamedCommand; hotkey -k "&" -name "hotkey7NamedCommand"; print ("The selected objects have been assigned to hot key 7" + "\n"); } proc hotkey8(){ nameCommand -ann "hotkey8" -c "pickList" hotkey8NamedCommand; hotkey -k "*" -name "hotkey8NamedCommand"; print ("The selected objects have been assigned to hot key 8" + "\n"); } proc hotkey9(){ nameCommand -ann "hotkey9" -c "pickList" hotkey9NamedCommand; hotkey -k "(" -name "hotkey9NamedCommand"; print ("The selected objects have been assigned to hot key 9" + "\n"); } proc hotkey0(){ nameCommand -ann "hotkey0" -c "pickList" hotkey0NamedCommand; hotkey -k ")" -name "hotkey0NamedCommand"; print ("The selected objects have been assigned to hot key 0" + "\n"); } createQSSMWindow;