Last active
July 24, 2019 04:43
-
-
Save juliomarcos/2d5e8930c9b6ea6f24738e7ed1caa824 to your computer and use it in GitHub Desktop.
wireframeOnShaded MEL script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string $currPanel = `getPanel -withFocus`; // gets current panel with focus | |
string $panelType = `getPanel -to $currPanel`; // gets the panel type | |
// this is only applicable to the viewport (modelPanel in MEL's terminology) | |
if ($panelType == "modelPanel") | |
{ | |
int $wireOn = `modelEditor -q -wireframeOnShaded $currPanel`; // queries wireframeonShaded state | |
$wireOn = !$wireOn; // toggles the mode | |
modelEditor -e -wireframeOnShaded $wireOn $currPanel; // finally sets the new mode | |
} else { | |
error "The panel in focus is not a viewport."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment