Last active
December 10, 2019 13:42
-
-
Save yamahigashi/ad547d2f4347edef46b5493adb58da9f 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.api.OpenMaya as om | |
import maya.api.OpenMayaUI as omui | |
# マスクの足し算 | |
SLIM_MASK = omui.M3dView.kDisplayTextures | omui.M3dView.kDisplayMeshes | omui.M3dView.kDisplayGrid | omui.M3dView.kDisplayManipulators | |
# 引き算はこう | |
SLIM_MASK = omui.M3dView.kDisplayEverything > omui.M3dView.kDisplayGrid | |
ALL_MASK = omui.M3dView.kDisplayEverything | |
def hoge(mask): | |
av = omui.M3dView.active3dView() | |
for i in range(omui.M3dView.numberOf3dViews()): | |
av = omui.M3dView.get3dView(i) | |
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