Skip to content

Instantly share code, notes, and snippets.

@michaeltrainor
Last active September 5, 2017 10:44
Show Gist options
  • Save michaeltrainor/12bf5afb3e13e9addd4dd9b5886a07d4 to your computer and use it in GitHub Desktop.
Save michaeltrainor/12bf5afb3e13e9addd4dd9b5886a07d4 to your computer and use it in GitHub Desktop.
# third party libraries
import pymel.core as pm
menus = [i for i in sorted(pm.lsUI(menus=True)) if isinstance(i.getParent(), pm.ui.Window) and isinstance(i, pm.ui.Menu)]
for i in sorted(menus):
if i.shortName() == "Test":
i.delete()
break
test = pm.menu("Test", parent=pm.MelGlobals()["gMainWindow"]).asQtObject()
test.addSection("Bar")
test.addMenu("FOOBAR")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment