当前位置: 首页>>代码示例>>Python>>正文


Python cmds.about方法代码示例

本文整理汇总了Python中maya.cmds.about方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.about方法的具体用法?Python cmds.about怎么用?Python cmds.about使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maya.cmds的用法示例。


在下文中一共展示了cmds.about方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: info

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def info(self, title, description, text, align, width, height, *args):
        """ Create a window showing the text info with the description about any module.
        """
        # declaring variables:
        self.info_title       = title
        self.info_description = description
        self.info_text        = text
        self.info_winWidth    = width
        self.info_winHeight   = height
        self.info_align       = align
        # creating Info Window:
        if cmds.window('dpInfoWindow', query=True, exists=True):
            cmds.deleteUI('dpInfoWindow', window=True)
        dpInfoWin = cmds.window('dpInfoWindow', title='dpAutoRig - v'+DPAR_VERSION+' - '+self.langDic[self.langName]['i013_info']+' - '+self.langDic[self.langName][self.info_title], iconName='dpInfo', widthHeight=(self.info_winWidth, self.info_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False)
        # creating text layout:
        infoColumnLayout = cmds.columnLayout('infoColumnLayout', adjustableColumn=True, columnOffset=['both', 20], parent=dpInfoWin)
        cmds.separator(style='none', height=10, parent=infoColumnLayout)
        infoLayout = cmds.scrollLayout('infoLayout', parent=infoColumnLayout)
        if self.info_description:
            infoDesc = cmds.text(self.langDic[self.langName][self.info_description], align=self.info_align, parent=infoLayout)
        if self.info_text:
            infoText = cmds.text(self.info_text, align=self.info_align, parent=infoLayout)
        # call Info Window:
        cmds.showWindow(dpInfoWin) 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:26,代码来源:dpAutoRig.py

示例2: integratingInfo

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def integratingInfo(self, *args):
        Base.StartClass.integratingInfo(self)
        """ This method will create a dictionary with informations about integrations system between modules.
        """
        self.integratedActionsDic = {
            "module": {
                "revFootCtrlList": self.footCtrlList,
                "revFootCtrlGrpList": self.revFootCtrlGrpFinalList,
                "revFootCtrlShapeList": self.revFootCtrlShapeList,
                "toLimbIkHandleGrpList": self.toLimbIkHandleGrpList,
                "parentConstList": self.parentConstList,
                "scaleConstList": self.scaleConstList,
                "footJntList": self.footJntList,
                "ballRFList": self.ballRFList,
                "middleFootCtrlList": self.middleFootCtrlList,
                "reverseFootAttrList": self.reverseFootAttrList,
                "scalableGrp": self.aScalableGrp,
            }
        } 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:21,代码来源:dpFoot.py

示例3: except_hook

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def except_hook(self, typ, value, traceback, detail):
        """ custom except hook
        when the exception is caused by a spore module forward it to the
        logger and run the bug reporter """

        err = utils._formatGuiException(typ, value, traceback, detail)
        if not cmds.about(batch=True) and 'spore' in err.splitlines()[0]:
            self.logger.critical('Uncaught exception:\n', exc_info=(typ, value, traceback))

            spore_globals = sys._global_spore_dispatcher.spore_globals
            if spore_globals['REPORT']:
                error_info = (typ, value, traceback, detail)
                if spore_globals['AUTOMATIC_REPORT']:
                    rep = reporter.get_reporter()
                    rep.direct_submit()
                else:
                    reporter.show(error_info)

            return

        return utils._formatGuiException(typ, value, traceback, detail) 
开发者ID:wiremas,项目名称:spore,代码行数:23,代码来源:logging_util.py

示例4: loadSSDSolverPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def loadSSDSolverPlugin():
    """"""    
    os = cmds.about(os=1)

    if os == 'win64':
        pluginName = '%s.mll' % (SSD_SOLVER_PLUGIN_BASE_NAME)
    elif os == 'mac':
        pluginName = '%s.bundle' % (SSD_SOLVER_PLUGIN_BASE_NAME)
    elif os == 'linux64':
        pluginName = '%s.so' % (SSD_SOLVER_PLUGIN_BASE_NAME)

    if not cmds.pluginInfo(pluginName, q=True, l=True ):
        try:
            cmds.loadPlugin(pluginName)
            pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
            log.info('Plug-in: %s v%s loaded success!' % (pluginName, pluginVers))
        except: 
            log.info('Plug-in: %s, was not found on MAYA_PLUG_IN_PATH.' % (pluginName))
    else:
        pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
        log.info('Plug-in: %s v%s has been loaded!' % (pluginName, pluginVers))

#---------------------------------------------------------------------- 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:25,代码来源:setup.py

示例5: loadDeltaMushPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def loadDeltaMushPlugin():
    """"""   
    os = cmds.about(os=1)

    if os == 'win64':
        pluginName = '%s.mll' % (DELTA_MUSH_PLUGIN_BASE_NAME)
    elif os == 'mac':
        pluginName = '%s.bundle' % (DELTA_MUSH_PLUGIN_BASE_NAME)
    elif os == 'linux64':
        pluginName = '%s.so' % (DELTA_MUSH_PLUGIN_BASE_NAME)

    if not cmds.pluginInfo(pluginName, q=True, l=True ):
        try:
            cmds.loadPlugin(pluginName)
            pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
            log.info('Plug-in: %s v%s loaded success!' % (pluginName, pluginVers))
        except:
            log.info('Plug-in: %s, was not found on MAYA_PLUG_IN_PATH.' % (pluginName))
    else:
        pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
        log.info('Plug-in: %s v%s has been loaded!' % (pluginName, pluginVers))

#---------------------------------------------------------------------- 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:25,代码来源:setup.py

示例6: __init__

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def __init__(self, total, message=None):
        # set numeration variables
        self._value = 0
        self._total = total
        self._message = message

        # get progress bar
        self._bar = None
        self._batch = cmds.about(batch=True)

        if not self._batch:
            self._bar = mel.eval("$tmp = $gMainProgressBar")
            cmds.progressBar(
                self._bar,
                edit=True,
                isInterruptable=False,
                status=self.message,
                minValue=0,
                maxValue=total
            ) 
开发者ID:robertjoosten,项目名称:maya-skinning-tools,代码行数:22,代码来源:progress.py

示例7: add_to_filemenu

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def add_to_filemenu():
    """Add Pyblish to file-menu

    .. note:: We're going a bit hacky here, probably due to my lack
        of understanding for `evalDeferred` or `executeDeferred`,
        so if you can think of a better solution, feel free to edit.

    """

    if hasattr(cmds, 'about') and not cmds.about(batch=True):
        # As Maya builds its menus dynamically upon being accessed,
        # we force its build here prior to adding our entry using it's
        # native mel function call.
        mel.eval("evalDeferred buildFileMenu")

        # Serialise function into string
        script = inspect.getsource(_add_to_filemenu)
        script += "\n_add_to_filemenu()"

        # If cmds doesn't have any members, we're most likely in an
        # uninitialized batch-mode. It it does exists, ensure we
        # really aren't in batch mode.
        cmds.evalDeferred(script) 
开发者ID:pyblish,项目名称:pyblish-maya,代码行数:25,代码来源:lib.py

示例8: run_tests_from_commandline

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def run_tests_from_commandline():
    """Runs the tests in Maya standalone mode.

    This is called when running cmt/bin/runmayatests.py from the commandline.
    """
    import maya.standalone

    maya.standalone.initialize()

    # Make sure all paths in PYTHONPATH are also in sys.path
    # When a maya module is loaded, the scripts folder is added to PYTHONPATH, but it doesn't seem
    # to be added to sys.path. So we are unable to import any of the python files that are in the
    # module/scripts folder. To workaround this, we simply add the paths to sys ourselves.
    realsyspath = [os.path.realpath(p) for p in sys.path]
    pythonpath = os.environ.get("PYTHONPATH", "")
    for p in pythonpath.split(os.pathsep):
        p = os.path.realpath(p)  # Make sure symbolic links are resolved
        if p not in realsyspath:
            sys.path.insert(0, p)

    run_tests()

    # Starting Maya 2016, we have to call uninitialize
    if float(cmds.about(v=True)) >= 2016.0:
        maya.standalone.uninitialize() 
开发者ID:chadmv,项目名称:cmt,代码行数:27,代码来源:mayaunittest.py

示例9: install

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def install():
    """Run all compatibility functions"""
    if cmds.about(version=True) == "2018":
        remove_googleapiclient() 
开发者ID:getavalon,项目名称:core,代码行数:6,代码来源:compat.py

示例10: _on_maya_initialized

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def _on_maya_initialized(*args):
    api.emit("init", args)

    if cmds.about(batch=True):
        logger.warning("Running batch mode ...")
        return

    # Keep reference to the main Window, once a main window exists.
    get_main_window() 
开发者ID:getavalon,项目名称:core,代码行数:11,代码来源:pipeline.py

示例11: checkForUpdate

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def checkForUpdate(self, verbose=True, *args):
        """ Check if there's an update for this current script version.
            Output the result in a window.
        """
        print "\n", self.langDic[self.langName]['i084_checkUpdate']
        
        # compare current version with GitHub master
        rawResult = utils.checkRawURLForUpdate(DPAR_VERSION, DPAR_RAWURL)
        
        # call Update Window about rawRsult:
        if rawResult[0] == 0:
            if verbose:
                self.updateWin(rawResult, 'i085_updated')
        elif rawResult[0] == 1:
            self.updateWin(rawResult, 'i086_newVersion')
        elif rawResult[0] == 2:
            if verbose:
                self.updateWin(rawResult, 'i087_rawURLFail')
        elif rawResult[0] == 3:
            if verbose:
                self.updateWin(rawResult, 'i088_internetFail')
        elif rawResult[0] == 4:
            if verbose:
                self.updateWin(rawResult, 'e008_failCheckUpdate')
    
    
    # Start working with Guide Modules: 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:29,代码来源:dpAutoRig.py

示例12: updateWin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def updateWin(self, rawResult, text, *args):
        """ Create a window showing the text info with the description about any module.
        """
        # declaring variables:
        self.update_checkedNumber = rawResult[0]
        self.update_remoteVersion = rawResult[1]
        self.update_remoteLog     = rawResult[2]
        self.update_text          = text
        self.update_winWidth      = 305
        self.update_winHeight     = 300
        # creating Update Window:
        if cmds.window('dpUpdateWindow', query=True, exists=True):
            cmds.deleteUI('dpUpdateWindow', window=True)
        dpUpdateWin = cmds.window('dpUpdateWindow', title='dpAutoRigSystem - '+self.langDic[self.langName]['i089_update'], iconName='dpInfo', widthHeight=(self.update_winWidth, self.update_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False)
        # creating text layout:
        updateLayout = cmds.columnLayout('updateLayout', adjustableColumn=True, columnOffset=['both', 20], rowSpacing=5, parent=dpUpdateWin)
        if self.update_text:
            updateDesc = cmds.text("\n"+self.langDic[self.langName][self.update_text], align="center", parent=updateLayout)
            cmds.text("\n"+DPAR_VERSION+self.langDic[self.langName]['i090_currentVersion'], align="left", parent=updateLayout)
        if self.update_remoteVersion:
            cmds.text(self.update_remoteVersion+self.langDic[self.langName]['i091_onlineVersion'], align="left", parent=updateLayout)
            cmds.separator(height=30)
            if self.update_remoteLog:
                remoteLog = self.update_remoteLog.replace("\\n", "\n")
                cmds.text(self.langDic[self.langName]['i171_updateLog']+":\n", align="center", parent=updateLayout)
                cmds.text(remoteLog, align="left", parent=updateLayout)
                cmds.separator(height=30)
            whatsChangedButton = cmds.button('whatsChangedButton', label=self.langDic[self.langName]['i117_whatsChanged'], align="center", command=partial(utils.visitWebSite, DPAR_WHATSCHANGED), parent=updateLayout)
            visiteGitHubButton = cmds.button('visiteGitHubButton', label=self.langDic[self.langName]['i093_gotoWebSite'], align="center", command=partial(utils.visitWebSite, DPAR_GITHUB), parent=updateLayout)
            if (int(cmds.about(version=True)[:4]) < 2019) and platform.system() == "Darwin": #Maya 2018 or older on macOS
                upgradeSSLmacOSButton = cmds.button('upgradeSSLmacOSButton', label=self.langDic[self.langName]['i164_sslMacOS'], align="center", backgroundColor=(0.8, 0.4, 0.4), command=partial(utils.visitWebSite, SSL_MACOS), parent=updateLayout)
            downloadButton = cmds.button('downloadButton', label=self.langDic[self.langName]['i094_downloadUpdate'], align="center", command=partial(self.downloadUpdate, DPAR_MASTERURL, "zip"), parent=updateLayout)
            installButton = cmds.button('installButton', label=self.langDic[self.langName]['i095_installUpdate'], align="center", command=partial(self.installUpdate, DPAR_MASTERURL, self.update_remoteVersion), parent=updateLayout)
        # automatically check for updates:
        cmds.separator(height=30)
        self.autoCheckUpdateCB = cmds.checkBox('autoCheckUpdateCB', label=self.langDic[self.langName]['i092_autoCheckUpdate'], align="left", value=self.userDefAutoCheckUpdate, changeCommand=self.setAutoCheckUpdatePref, parent=updateLayout)
        cmds.separator(height=30)
        # call Update Window:
        cmds.showWindow(dpUpdateWin)
        print self.langDic[self.langName][self.update_text] 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:42,代码来源:dpAutoRig.py

示例13: autoCheckUpdate

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def autoCheckUpdate(self, *args):
        """ Store user choose about automatically check for update in an optionVar.
            If active, try to check for update once a day.
        """
        firstTimeOpenDPAR = False
        # verify if there is an optionVar of last autoCheckUpdate checkBox choose value by user in the maya system:
        autoCheckUpdateExists = cmds.optionVar(exists='dpAutoRigAutoCheckUpdate')
        if not autoCheckUpdateExists:
            cmds.optionVar(intValue=('dpAutoRigAutoCheckUpdate', 1))
            firstTimeOpenDPAR = True
        
        # get its value puting in a variable userDefAutoCheckUpdate:
        self.userDefAutoCheckUpdate = cmds.optionVar(query='dpAutoRigAutoCheckUpdate')
        if self.userDefAutoCheckUpdate == 1:
            # verify if there is an optionVar for store the date of the lastest autoCheckUpdate ran in order to avoid many hits in the GitHub server:
            todayDate = str(datetime.datetime.now().date())
            lastAutoCheckUpdateExists = cmds.optionVar(exists='dpAutoRigLastDateAutoCheckUpdate')
            if not lastAutoCheckUpdateExists:
                cmds.optionVar(stringValue=('dpAutoRigLastDateAutoCheckUpdate', todayDate))
            # get its value puting in a variable userDefAutoCheckUpdate:
            lastDateAutoCheckUpdate = cmds.optionVar(query='dpAutoRigLastDateAutoCheckUpdate')
            if not lastDateAutoCheckUpdate == todayDate:
                # then check for update:
                self.checkForUpdate(verbose=False)
                cmds.optionVar(stringValue=('dpAutoRigLastDateAutoCheckUpdate', todayDate))
        
        # force checkForUpdate if it's the first time openning the dpAutoRigSystem in this computer:
        if firstTimeOpenDPAR:
            self.checkForUpdate(verbose=True)
        
        
    
    
    ###################### End: UI
    
    
    ###################### Start: Rigging Modules Instances 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:39,代码来源:dpAutoRig.py

示例14: integratingInfo

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def integratingInfo(self, *args):
        Base.StartClass.integratingInfo(self)
        """ This method will create a dictionary with informations about integrations system between modules.
        """
        self.integratedActionsDic = {
            "module": {
                "ikCtrlList": self.ikExtremCtrlList,
                "ikCtrlZeroList": self.ikExtremCtrlZeroList,
                "ikPoleVectorZeroList": self.ikPoleVectorCtrlZeroList,
                "ikHandleGrpList": self.ikHandleToRFGrpList,
                "ikHandlePointConstList": self.ikHandlePointConstList,
                "ikFkBlendGrpToRevFootList": self.ikFkBlendGrpToRevFootList,
                "worldRefList": self.worldRefList,
                "worldRefShapeList": self.worldRefShapeList,
                "limbTypeName": self.limbTypeName,
                "extremJntList": self.extremJntList,
                "parentConstToRFOffsetList": self.parentConstToRFOffsetList,
                "fixIkSpringSolverGrpList": self.fixIkSpringSolverGrpList,
                "limbStyle": self.limbStyle,
                "quadFrontLegList": self.quadFrontLegList,
                "integrateOrigFromList": self.integrateOrigFromList,
                "ikStretchExtremLoc": self.ikStretchExtremLocList,
                "ikFkNetworkList": self.ikFkNetworkList,
                "limbManualVolume": "limbManualVolume",
                "fkIsolateConst": self.afkIsolateConst,
                "scalableGrp": self.aScalableGrps,
            }
        } 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:30,代码来源:dpLimb.py

示例15: cvBaseGuide

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import about [as 别名]
def cvBaseGuide(self, ctrlName, r=1, *args):
        """Create a control to be used as a Base Guide control.
            Returns the main control (circle) and the radius control in a list.
        """
        # get radius by checking linear unit
        r = self.dpCheckLinearUnit(r)
        # create a simple circle curve:
        circle = cmds.circle(n=ctrlName, ch=True, o=True, nr=(0, 0, 1), d=3, s=8, radius=r)[0]
        radiusCtrl = cmds.circle(n=ctrlName+"_RadiusCtrl", ch=True, o=True, nr=(0, 1, 0), d=3, s=8, radius=(r/4.0))[0]
        # rename curveShape:
        self.renameShape([circle, radiusCtrl])
        # configure system of limits and radius:
        cmds.setAttr(radiusCtrl+".translateX", r)
        cmds.parent(radiusCtrl, circle, relative=True)
        cmds.transformLimits(radiusCtrl, tx=(0.01, 1), etx=(True, False))
        self.setLockHide([radiusCtrl], ['ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'])
        # find makeNurbCircle history of the circles:
        historyList = self.findHistory([circle, radiusCtrl], 'makeNurbCircle')
        circleHistory     = historyList[0]
        radiusCtrlHistory = historyList[1]
        # rename and make a connection for circle:
        circleHistory = cmds.rename(circleHistory, circle+"_makeNurbCircle")
        cmds.connectAttr(radiusCtrl+".tx", circleHistory+".radius", force=True)
        radiusCtrlHistory = cmds.rename(radiusCtrlHistory, radiusCtrl+"_makeNurbCircle")
        # create a mutiplyDivide in order to automatisation the radius of the radiusCtrl:
        radiusCtrlMD = cmds.createNode('multiplyDivide', name=radiusCtrl+'_MD')
        cmds.connectAttr(radiusCtrl+'.translateX', radiusCtrlMD+'.input1X', force=True)
        cmds.setAttr(radiusCtrlMD+'.input2X', 0.15)
        cmds.connectAttr(radiusCtrlMD+".outputX", radiusCtrlHistory+".radius", force=True)
        # colorize curveShapes:
        self.colorShape([circle], 'yellow')
        self.colorShape([radiusCtrl], 'cyan')
        if (int(cmds.about(version=True)[:4]) > 2016):
            cmds.setAttr(circle+"Shape.lineWidth", 2)
        cmds.select(clear=True)
        return [circle, radiusCtrl] 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:38,代码来源:dpControls.py


注:本文中的maya.cmds.about方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。