Skip to content

Instantly share code, notes, and snippets.

@juliomarcos
Last active July 24, 2019 04:43
Show Gist options
  • Save juliomarcos/2d5e8930c9b6ea6f24738e7ed1caa824 to your computer and use it in GitHub Desktop.
Save juliomarcos/2d5e8930c9b6ea6f24738e7ed1caa824 to your computer and use it in GitHub Desktop.
wireframeOnShaded MEL script
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