Skip to content

Instantly share code, notes, and snippets.

@coxevan
Last active February 12, 2017 05:52
Show Gist options
  • Save coxevan/aeb4149d63a704391a39c56b5befe294 to your computer and use it in GitHub Desktop.
Save coxevan/aeb4149d63a704391a39c56b5befe294 to your computer and use it in GitHub Desktop.
import maya.cmds as cmds
def wireframeSwitcher():
# Get the viewport object
viewport = cmds.getPanel( withFocus = True)
# If there is a model panel...
if 'modelPanel' in viewport:
currentState = cmds.modelEditor( viewport, q = True, displayAppearance= True )
if currentState.lower() == 'wireframe':
cmds.modelEditor( viewport, edit = True, displayAppearance = 'smoothShaded' )
else:
cmds.modelEditor( viewport, edit = True, displayAppearance = 'wireframe' )
return True
wireframeSwitcher( )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment