string $activePanel = `getPanel -wf`; string $thisCam = `modelPanel -q -cam $activePanel`; string $thisConnection = `connectionInfo -sfd ($thisCam + "Shape.imagePlane[0]")`; string $thisPlane[]; tokenize($thisConnection, ".", $thisPlane); if($thisPlane[0] == "") warning "No Image Plane Associated With This Camera"; else { int $panelState = `getAttr ($thisPlane[0] + ".displayMode")`; if($panelState != 0) setAttr ($thisPlane[0] + ".displayMode") 0; else setAttr ($thisPlane[0] + ".displayMode") 2; }