Skip to content

Instantly share code, notes, and snippets.

@yamahigashi
Created December 11, 2018 10:24
Show Gist options
  • Select an option

  • Save yamahigashi/13101b23c1f6afa38b143fd927ac1d41 to your computer and use it in GitHub Desktop.

Select an option

Save yamahigashi/13101b23c1f6afa38b143fd927ac1d41 to your computer and use it in GitHub Desktop.
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