def Menu(*args, **kwargs): #project prefix for unique UI names and basic naming variables proj = pg.project menuName = "%s Menu" % proj pMainMenu = "%s_MainMenu" % proj MainMayaWindow = mel.eval("$tempVar=$gMainWindow") if mc.menu(pMainMenu, q=1, ex=1): mc.deleteUI(pMainMenu) else: pass #build menu to main menu mc.menu(pMainMenu, to=1, l=menuName, p=MainMayaWindow) mc.menuItem(l="Refresh", c=rebuild, p=pMainMenu) #pipeline tools submenu pPipelineMenu = mc.menuItem(sm=1, l="Pipeline Tools", p=pMainMenu) mc.menuItem(l="File Manager", c=fileManager, p=pPipelineMenu) mc.menuItem(l="Asset Manager", c=assetManager, p=pPipelineMenu) mc.menuItem(l="Update All References", c=updateRefs, p=pPipelineMenu) mc.menuItem(l="Version Up Current", c=saveVersion, p=pPipelineMenu) mc.menuItem(l="Asset Publish And Version Up", c=partial(assPublishVersion, True), p=pPipelineMenu) mc.menuItem(l="Asset Publish Don't Version Up", c=partial(assPublishVersion, False), p=pPipelineMenu) mc.menuItem(l="Stage Publish (multi reference)", c=partial(stagePublish, False), p=pPipelineMenu) mc.menuItem(l="Change Project", c=setProject, p=pPipelineMenu) #anim tools submenu animMenu = mc.menuItem(sm=1, l="Anim Tools", p=pMainMenu) mc.menuItem(l="Space Matching", c=spaceMatching, p=animMenu) #rigging tools submenu riggingMenu = mc.menuItem(sm=1, l="Rigging Tools", p=pMainMenu) mc.menuItem(l="Import Template", c=importTemplate, p=riggingMenu) #lookDev tools submenu lookdevMenu = mc.menuItem(sm=1, l="Look Dev Tools", p=pMainMenu) mc.menuItem(l="Collect Textures", c=collectTextures, p=lookdevMenu) # run project setter os.environ["MAYA_PROJECT_PATH"] = "X:/Production" os.environ["MAYA_CURRENT_PROJECT"] = "Frogger" # help stuff helpMenu = mc.menuItem(sm=1, l="Help", p=pMainMenu) mc.menuItem(l="Open Help Docs", c=open_help, p=helpMenu) # set project window sp.setProject()
def setProject(*args): reload(sp) sp.setProject()