/* visToggle.mel by Alex Hogan - www.alexhogan.com Created March 15, 2004 This script toggles one of the settings on the camera show panel. I have been using a set of scripts to do this, and it was annoying having so many scripts clogging my scripts directory. */ global proc visToggle ( string $toggleAtt ) { /* This script is meant to toggle the specified setting on the Show-> dropdown inside a modelEditor. Use one string argument that tells the script what to check for. */ $curPanel = `getPanel -withFocus`; //find out what camera the user is in //create a command to query the current camera's attribute setting string $queryCommand = "modelEditor -q -" + $toggleAtt + " " + $curPanel; //execute the command $curPanelXStat = `eval $queryCommand`; //get the current state $curPanelXStat = !($curPanelXStat); //flip the current state string $toggleCommand = "modelEditor -e -" + $toggleAtt + " " + $curPanelXStat + " " + $curPanel; ; eval ( $toggleCommand ); //apply the flipped state to the modelPanel /* Valid arguments are: allObjects nurbsCurves nurbsSurfaces polymeshes subdivSurfaces planes lights cameras joints ikHandles deformers dynamics fluids locators dimensions handles pivots textures strokes cv hulls grid wos xray */ };