Python maya.cmds 模块,about() 实例源码

我们从Python开源项目中,提取了以下9个代码示例,用于说明如何使用maya.cmds.about()

项目:cmt    作者:chadmv    | 项目源码 | 文件源码
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()
项目:SETools    作者:dtzxporter    | 项目源码 | 文件源码
def ImportFileSelectDialog():
    importFrom = None
    if cmds.about(version=True)[:4] == "2012": # Support for newer versions
        importFrom = cmds.fileDialog2(fileMode=1, fileFilter="SEAnim Files (*.seanim)", caption="Import SEAnim")
    else:
        importFrom = cmds.fileDialog2(fileMode=1, dialogStyle=2, fileFilter="SEAnim Files (*.seanim)", caption="Import SEAnim")

    if importFrom == None or len(importFrom) == 0 or importFrom[0].strip() == "":
        return None
    path = importFrom[0].strip()

    pathSplit = os.path.splitext(path) # Fix bug with Maya 2013
    if pathSplit[1] == ".*":
        path = pathSplit

    return path

# Attempt to resolve the animType for a bone based on a given list of modifier bones, returns None if no override is needed
项目:deltaMushToSkinCluster    作者:jeanim    | 项目源码 | 文件源码
def enableaPlugin(filename):
    extDict = {'win64':'mll','mac':'bundle','linux':'so','linux64':'so'}
    os = cmds.about(os=True)
    ext = extDict[os]
    version = cmds.about(v=True)[:4]
    pluginName = 'deltaMushToSkinCluster_%s' % version
    fileFullName = '%s.%s' % (pluginName,ext)
    rootPath = getParentPath(currentFileDirectory())
    pluginsPath = rootPath+'/plug-ins/'
    pluginFilePath = pluginsPath+fileFullName
    pluginStr = mel.eval('getenv "MAYA_PLUG_IN_PATH";')+';'+pluginsPath
    mel.eval('putenv "MAYA_PLUG_IN_PATH" "%s";' % pluginStr)
    with open(filename,'a+') as f:
        state = True
        for line in f.readlines():
            if re.findall(fileFullName,line):
                state = False
        if state:
            f.write(r'evalDeferred("autoLoadPlugin(\"\", \"%s\", \"%s\")");' % (fileFullName,pluginName))

    if not cmds.pluginInfo( pluginFilePath, query=True, autoload=True):
        cmds.pluginInfo( pluginFilePath, edit=True, autoload=True)

    if not cmds.pluginInfo(pluginFilePath,query=True,loaded=True):
        cmds.loadPlugin(pluginFilePath)
项目:SceneExplorer    作者:mochio326    | 项目源码 | 文件源码
def maya_api_version():
    return int(cmds.about(api=True))
项目:pipeline    作者:liorbenhorin    | 项目源码 | 文件源码
def maya_api_version():
    return int(cmds.about(api=True))
项目:pipeline    作者:liorbenhorin    | 项目源码 | 文件源码
def maya_version():
    return cmds.about(version=True)
项目:SiShelf    作者:mochio326    | 项目源码 | 文件源码
def maya_api_version():
    return int(cmds.about(api=True))
项目:core    作者:getavalon    | 项目源码 | 文件源码
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.
    self._parent = {
        widget.objectName(): widget
        for widget in QtWidgets.QApplication.topLevelWidgets()
    }["MayaWindow"]
项目:core    作者:getavalon    | 项目源码 | 文件源码
def install():
    """Run all compatibility functions"""
    if cmds.about(version=True) == "2018":
        remove_googleapiclient()