Skip to content

Instantly share code, notes, and snippets.

@RDelet
Last active August 29, 2015 14:21
Show Gist options
  • Save RDelet/756dec0107220ddd33b6 to your computer and use it in GitHub Desktop.
Save RDelet/756dec0107220ddd33b6 to your computer and use it in GitHub Desktop.
It's custom marking menu exemple
import pymel.core as pmc
import maya.mel
class CheckForMM():
#----- Get object Infos
@classmethod
def getObjInfos(cls):
objSel = pmc.selected()
# blablabla
#----- Get panel Infos
@classmethod
def checkPanel(cls):
#----- Get graphEditor
graphEditor = pmc.panel('graphEditor1', ex=True)
panelFocus = pmc.getPanel(wf=True)
# blablabla
#----- QDManip markingMenu Animation Select
class QdMarkingMenuSelect():
#####################################################################
#----- Create Popup
#####################################################################
@classmethod
def popupMM(cls, parent):
#----- If UI Exists delete
if pmc.popupMenu('tempMM', exists=True):
pmc.deleteUI('tempMM')
#----- popupMenu
popupMM = pmc.popupMenu('tempMM', b=1, ctl=False, alt=False, sh=False, aob=True, p=parent, mm=True)
return popupMM
#----- Check Process
@classmethod
def checkProcess(cls, *arg):
check = CheckForMM()
qdAttrType = check.getObjInfos()
graphEditor, panelFocus = check.checkPanel()
#----- Launch markingMenu
if graphEditor is True and str(panelFocus) == 'graphEditor1':
cls.qdGraphEditorMM()
else:
if qdAttrType is not None:
if 'QDManip' in str(qdAttrType) or 'QDMocap' in str(qdAttrType):
cls.qdmAnimationSelectMM()
elif str(qdAttrType) == 'RigSkin':
cls.qdmRigSkinMM()
else:
cls.qdNoSelectMM()
#----- QD Animation Select
@classmethod
def qdmAnimationSelectMM(cls, *arg):
#----- Get Popup:
popupMM = cls.popupMM('viewPanes')
#----- Create Item
pmc.menuItem('LipsUp', l='Lips Up', c=LipsUp, rp='N', p=popupMM)
pmc.menuItem('LipsDn', l='Lips Dn', c=LipsDn, rp='S', p=popupMM)
# blablabla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment