Exemplo n.º 1
0
def uiMainMenu_add():
    def build(*a):
        log.info("Building Top CGM Menu...")
        import cgmToolbox
        cgmToolbox.uiBuild_cgmMenu(*a)

    if not hasattr(maya, '_cgmMenu'):
        log.info('No _cgmMenu found')

        menu = mUI.MelMainMenu(l='CGM',
                               pmc=build,
                               tearOff=True,
                               postMenuCommandOnce=True)
        setattr(maya, '_cgmMenu', menu)
Exemplo n.º 2
0
def setupCGMMenu():
    if not mc.optionVar(ex='cgmVar_ToolboxMainMenu'):
        mc.optionVar(iv=('cgmVar_ToolboxMainMenu', 1))

    if not mc.optionVar(q='cgmVar_ToolboxMainMenu'):
        return

    if not hasattr(maya, '_cgmToolboxMenu'):

        def cb(*a):
            import cgmToolbox
            cgmToolbox.buildCGMToolsMenu(*a)

        menu = mUI.MelMainMenu(l='CGM Tools', pmc=cb, tearOff=True)
        setattr(maya, '_cgmToolboxMenu', menu)