Last active
December 8, 2015 10:15
-
-
Save csaez/c957a464896b1fb164ec to your computer and use it in GitHub Desktop.
MAYA: Toggle viewport visibility by type
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 mc | |
def toggleVisibilityByType(type_): | |
options = {type_: True} | |
state = mc.modelEditor("modelPanel4", q=True, **options) | |
options[type_] = not state | |
mc.modelEditor("modelPanel4", e=True, **options) | |
toggleCurvesVisibility = lambda: toggleVisibilityByType("nurbsCurves") | |
toggleJointsVisibility = lambda: toggleVisibilityByType("joints") | |
toggleMeshesVisibility = lambda: toggleVisibilityByType("polymeshes") | |
# toggleCurvesVisibility() | |
# toggleJointsVisibility() | |
# toggleMeshesVisibility() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment