Example #1
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")
Example #2
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))
Example #3
0
def uiBuild_cgmMenu(*args):
    _str_func = 'uiBuild_cgmMenu'
    menu = maya._cgmMenu
    menu.clear()
    reload(UICHUNKS)
    log.info("|{0}| >> building...".format(_str_func))
    """
    _l_sel = mc.ls(sl=True)
    if _l_sel:_b_sel = True
    _b_sel_pair = False
    _b_sel_few = False
    _len_sel = len(_l_sel)
    if _len_sel  >= 2:
        _b_sel_pair = True
    if _len_sel >2:
        _b_sel_few = True"""

    #log.info("|{0}| >> Selected: {1}".format(_str_func,_l_sel))

    #mUI.MelMenuItem(menu, l='Open Tool Win',
    #                c=lambda *args: ToolboxWindow())
    mc.menuItem(p=menu,
                l='Open Tool Win',
                c=lambda *a: mc.evalDeferred(callUI, lp=1))

    #>>Snap ----------------------------------------------------------------------
    _snap = mc.menuItem(p=menu, l='Snap', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_snap(_snap)

    _create = mc.menuItem(
        p=menu,
        l='Create',
        subMenu=True,
        tearOff=True,
        ann='Create objects from selected objects or components')
    UICHUNKS.uiSection_createFromSel(_create)

    #>>TD ----------------------------------------------------------------------
    _td = mc.menuItem(p=menu, l='TD/Create', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_selection(_td)
    UICHUNKS.uiSection_riggingUtils(_td)
    UICHUNKS.uiSection_attributes(_td)
    UICHUNKS.uiSection_rayCast(_td)
    UICHUNKS.uiSection_distance(_td)
    UICHUNKS.uiSection_joints(_td)
    UICHUNKS.uiSection_sdk(_td)
    UICHUNKS.uiSection_shapes(_td)
    UICHUNKS.uiSection_curves(_td)
    UICHUNKS.uiSection_mesh(_td)
    UICHUNKS.uiSection_skin(_td)
    UICHUNKS.uiSection_nodes(_td)

    #>>>Anim ----------------------------------------------------------------------
    _anim = mc.menuItem(p=menu, l='Anim', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_animUtils(_anim)

    #>>Layout ----------------------------------------------------------------------
    _layout = mc.menuItem(p=menu, l='Layout', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_layout(_layout)

    #>>LightStudio ----------------------------------------------------------------------
    #_layout = mc.menuItem(p=menu,l='LightStudio',subMenu = True, tearOff = True)
    UICHUNKS.LIGHTLOOMLITE.uiMenu(menu)

    #>>Mrs ----------------------------------------------------------------------
    _layout = mc.menuItem(p=menu, l='MRS', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_mrs(_layout)

    #>>Hotkeys ----------------------------------------------------------------------
    _hotkeys = mc.menuItem(p=menu, l='Hotkeys', subMenu=True, tearOff=False)
    UICHUNKS.uiSection_hotkeys(_hotkeys)

    #>>dev ----------------------------------------------------------------------
    _dev = mc.menuItem(p=menu, l='Dev', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_dev(_dev)

    #>>Help ----------------------------------------------------------------------
    _git = mc.menuItem(p=menu, l='Git', subMenu=True, tearOff=True)
    #cgmUI.uiSection_help(_help)
    UICHUNKS.uiSection_git(_git)

    #>>Help ----------------------------------------------------------------------
    _help = mc.menuItem(p=menu, l='Help', subMenu=True, tearOff=True)
    #cgmUI.uiSection_help(_help)
    UICHUNKS.uiSection_help(_help)

    mUI.MelMenuItemDiv(menu)
    mc.menuItem(p=menu,
                l='Rebuild',
                ann='Rebuild the top menu',
                c=lambda *a: mc.evalDeferred(uiMainMenu_rebuild, lp=0))
    if _len_sel  >= 2:
        _b_sel_pair = True
    if _len_sel >2:
        _b_sel_few = True"""

    #log.info("|{0}| >> Selected: {1}".format(_str_func,_l_sel))

    #mUI.MelMenuItem(menu, l='Open Tool Win',
    #                c=lambda *args: ToolboxWindow())

    mc.menuItem(p=menu,
                l='Open Toolbox UI',
                c=lambda *a: mc.evalDeferred(callUI, lp=1))

    #Utils ==========================================================================
    mUI.MelMenuItemDiv(menu, label='General')

    #>>Snap ----------------------------------------------------------------------

    _snap = mc.menuItem(p=menu, l='Snap', subMenu=True, tearOff=True)
    UICHUNKS.uiSection_snap(_snap)

    _create = mc.menuItem(
        p=menu,
        l='Create',
        subMenu=True,
        tearOff=True,
        ann='Create objects from selected objects or components')
    UICHUNKS.uiSection_createFromSel(_create)

    UICHUNKS.uiSection_selection(menu)