global proc EJL_toggleWires() { string $focus = `getPanel -withFocus`; if ( `getPanel -to $focus` == "modelPanel") { string $mode = `modelEditor -q -displayAppearance $focus`; int $xray = `modelEditor -q -xray $focus`; int $wos = `modelEditor -q -wos $focus`; // XRAY (from xray wos) if ( $mode == "flatShaded" && $xray == 1 && $wos == 1 ) { modelEditor -e -xray 1 -wos 0 -displayAppearance "smoothShaded" -displayTextures off -displayLights "default" $focus; } // wireframe (from xray) else if ( $mode == "smoothShaded" && $xray == 1 && $wos == 0 ) { modelEditor -e -xray 0 -wos 0 -displayAppearance "wireframe" $focus; } // XRAY WOS (wireframe) else if ( $mode == "wireframe" && $xray == 0 && $wos == 0 ) { modelEditor -e -xray 1 -wos 1 -displayAppearance "flatShaded" $focus; } // default else { modelEditor -e -xray 0 -wos 0 -displayAppearance "wireframe" $focus; } } } EJL_ToggleWires();