Here is a mel I wrote to do just that:
//Start mel script code
//==========================
/* Image Plane Toggle
Toggles the visibility of all Image Planes in your scene
Any bugs or problems, send them to
mhovland@midwaygames.com
*/
//Start of IP_Toggle Script
global proc mh_IP_Toggle()
{
// INTERFACE STUFF//
//kill the window if it exists already
if (window -exists iptWindow
)
{
deleteUI -window iptWindow;
}
//define the window
string $iptWin = window
-title "Image Plane Toggle"
-widthHeight 210 105
-tlc 150 150
-sizeable false
iptWindow
;
//column layout for the window
columnLayout;
//define some buttons
button
-label "Hide Image Planes"
-width 200
-height 25
-command "hideEm"
hideBtn;
button
-label "Show Image Planes"
-width 200
-height 25
-command "showEm"
showBtn;
//END INTERFACE STUFF//
showWindow $iptWin;
}
//Some procedures for the buttons to do
global proc hideEm()
{
string $ipHideIndex;
string $ipHideVar[] = ls -type imagePlane
;
if (size($ipHideVar) == 0)
error ("==No Image Planes in your Scene==");
for ($ipHideIndex in $ipHideVar)
{
setAttr ($ipHideIndex+".displayMode") 0;
}
}
global proc showEm()
{
string $ipShowIndex;
string $ipShowVar[] = ls -type imagePlane
;
if (size($ipShowVar) == 0)
error ("==No Image Planes in your Scene==");
for ($ipShowIndex in $ipShowVar)
{
setAttr ($ipShowIndex+".displayMode") 3;
}
}
//End button procedures
//================================
//end mel script code
This is one of my first scripts with an interface, so it may not be the best implimentation, but it works just fine.
Use it all you want, if you make adjustments to it, send them back my way.
Enjoy,