View Single Post
# 2 14-10-2014 , 10:23 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
I'm guessing you'd like a fast way to toggle isolate selection. Another if statement nested in your "if ($panelType == "modelPanel") " block that queries the state of isolate select and changes the value accordingly would eliminate the need for another script. This is the script I use, I have it bound to a mouse button.
Code:
////////////////////////////////////////////////////////////
// Toggles isolate select

{
        
        // get panel that is under the mouse pointer.
        string $currentPanel = `getPanel -up`;
        
        // if none available, get panel with focus.
        if ($currentPanel == "")
                $currentPanel = `getPanel -wf`;
        
        // make sure panel is indeed a modeling panel.
        if (`getPanel -to $currentPanel` == "modelPanel"){
               
		// if isolate selection is on, turn it off
                if (`isolateSelect -q -state $currentPanel`){
                        isolateSelect -state 0 $currentPanel;                           
                }else{
			//else turn on
                        enableIsolateSelect $currentPanel 1;
                        isoSelectAutoAddNewObjs $currentPanel 1;
                        isolateSelect -state 1 $currentPanel;
                }
        }
        
}


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::