Skip to content

Instantly share code, notes, and snippets.

@ben-hearn-sb
Created December 7, 2015 17:05
Show Gist options
  • Save ben-hearn-sb/4e398b683d0e30db924c to your computer and use it in GitHub Desktop.
Save ben-hearn-sb/4e398b683d0e30db924c to your computer and use it in GitHub Desktop.
def addMenuItem(parentMenu=None, labelName='', callback=None, sub=False, tearable=False):
if callback == None:
newMenu = pm.menuItem(parent=parentMenu, label=labelName, subMenu=sub, tearOff=tearable)
return newMenu
else:
pm.menuItem(p=parentMenu, label=labelName, command=pm.Callback(callback))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment