Created
December 11, 2018 10:24
-
-
Save yamahigashi/13101b23c1f6afa38b143fd927ac1d41 to your computer and use it in GitHub Desktop.
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
| import maya.api.OpenMaya as om | |
| import maya.api.OpenMayaUI as omui | |
| # ====================================================================== | |
| SLIM_MASK = omui.M3dView.kDisplayTextures + omui.M3dView.kDisplayMeshes + omui.M3dView.kDisplayGrid | |
| ALL_MASK = omui.M3dView.kDisplayEverything | |
| def hoge(mask): | |
| av = omui.M3dView.active3dView() | |
| av.setObjectDisplay(mask) | |
| av.refresh() | |
| def toggle(): | |
| av = omui.M3dView.active3dView() | |
| current = av.objectDisplay() | |
| if SLIM_MASK == current: | |
| hoge(ALL_MASK) | |
| else: | |
| hoge(SLIM_MASK) | |
| toggle() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment