python类about()的实例源码

mayaunittest.py 文件源码 项目:cmt 作者: chadmv 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
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()
SEToolsPlugin.py 文件源码 项目:SETools 作者: dtzxporter 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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
dm2scSetup.py 文件源码 项目:deltaMushToSkinCluster 作者: jeanim 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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)
explorer.py 文件源码 项目:SceneExplorer 作者: mochio326 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def maya_api_version():
    return int(cmds.about(api=True))
maya_warpper.py 文件源码 项目:pipeline 作者: liorbenhorin 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def maya_api_version():
    return int(cmds.about(api=True))
maya_warpper.py 文件源码 项目:pipeline 作者: liorbenhorin 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def maya_version():
    return cmds.about(version=True)
lib.py 文件源码 项目:SiShelf 作者: mochio326 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def maya_api_version():
    return int(cmds.about(api=True))
pipeline.py 文件源码 项目:core 作者: getavalon 项目源码 文件源码 阅读 84 收藏 0 点赞 0 评论 0
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"]
compat.py 文件源码 项目:core 作者: getavalon 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def install():
    """Run all compatibility functions"""
    if cmds.about(version=True) == "2018":
        remove_googleapiclient()


问题


面经


文章

微信
公众号

扫码关注公众号