Last active
February 12, 2017 05:52
-
-
Save coxevan/aeb4149d63a704391a39c56b5befe294 to your computer and use it in GitHub Desktop.
This file contains 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
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