Пример #1
0
def buildCGMToolsMenu(*a):
    menu = maya._cgmToolboxMenu
    menu.clear()

    mUI.MelMenuItem(menu, l='Open Toolbox Window', c=lambda *a: ui())
    for toolCatName, toolSetupData in TOOL_CATS:
        catMenu = mUI.MelMenuItem(menu, l=toolCatName, sm=True, tearOff=True)
        for toolName, toolDesc, toolCB in toolSetupData:
            mUI.MelMenuItem(catMenu,
                            l=toolName,
                            ann=toolDesc,
                            c=toolCB,
                            tearOff=True)
Пример #2
0
    def buildMenu_first(self):
        self.uiMenu_FirstMenu.clear()
        #>>> Reset Options

        setupMenu = mc.optionVar(q='cgmVar_ToolboxMainMenu')
        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Create cgm Tools Menu",
                        cb=setupMenu,
                        c=lambda *a: mc.optionVar(iv=('cgmVar_ToolboxMainMenu',
                                                      not setupMenu)))
        mUI.MelMenuItemDiv(self.uiMenu_FirstMenu)

        try:
            installer = AutoStartInstaller()
            mUI.MelMenuItem(self.uiMenu_FirstMenu,
                            l="Auto-Load On Maya Start",
                            cb=installer.isInstalled(),
                            c=lambda *a: AutoStartInstaller().install())
        except Exception, err:
            log.warning("Not loaded from cgmToolbox. No autoinstaller options")
Пример #3
0
class ui(TOOLBOX.ui):
    def buildMenu_first(self):
        self.uiMenu_FirstMenu.clear()
        #>>> Reset Options

        setupMenu = mc.optionVar(q='cgmVar_ToolboxMainMenu')
        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Create cgm Tools Menu",
                        cb=setupMenu,
                        c=lambda *a: mc.optionVar(iv=('cgmVar_ToolboxMainMenu',
                                                      not setupMenu)))
        mUI.MelMenuItemDiv(self.uiMenu_FirstMenu)

        try:
            installer = AutoStartInstaller()
            mUI.MelMenuItem(self.uiMenu_FirstMenu,
                            l="Auto-Load On Maya Start",
                            cb=installer.isInstalled(),
                            c=lambda *a: AutoStartInstaller().install())
        except Exception, err:
            log.warning("Not loaded from cgmToolbox. No autoinstaller options")

        mUI.MelMenuItemDiv(self.uiMenu_FirstMenu)

        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Dock",
                        c=lambda *a: self.do_dock())

        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Rebuild Main Menu",
                        c=lambda *a: uiMainMenu_rebuild())

        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Reload",
                        c=lambda *a: mc.evalDeferred(self.reload, lp=True))

        mUI.MelMenuItem(self.uiMenu_FirstMenu,
                        l="Reset",
                        c=lambda *a: mc.evalDeferred(self.reload, lp=True))