Пример #1
0
def setupCGMScriptPaths():
    thisFile = cgmPath.Path(__file__)
    #thisPath = os.sep.join(__file__.split(os.sep)[:-1])
    thisPath = thisFile.up().osPath()

    mayaScriptPaths = map(
        cgmPath.Path,
        maya.mel.eval('getenv MAYA_SCRIPT_PATH').split(os.pathsep))
    mayaScriptPathsSet = set(mayaScriptPaths)
    _paths = [
        os.path.join('cgm', 'mel', 'zooPy'),
        os.path.join('cgm', 'mel'),
        os.path.join('cgm', 'images'),
        os.path.join('cgm', 'lib', 'zoo'),
        os.path.join('cgm', 'lib', 'zoo', 'zooMel'),
        os.path.join('cgm', 'lib', 'zoo', 'zooPy'),
        os.path.join('cgm', 'core', 'mel'), 'Red9'
    ]

    for path in _paths:
        fullPath = cgmPath.Path(os.path.join(thisPath, path))
        if fullPath not in mayaScriptPathsSet:
            log.info(
                "setupCGMScriptPaths>> Path not found. Appending: {0}".format(
                    fullPath))
            mayaScriptPaths.append(cgmPath.Path(fullPath.asFriendly()))
            mayaScriptPaths.extend(fullPath.dirs(recursive=True))

            mayaScriptPaths = mUI.removeDupes(mayaScriptPaths)
            newScriptPath = os.pathsep.join([p for p in mayaScriptPaths])
            #for p in mayaScriptPaths:
            #print ("{0} >> {1}".format(p,p.unresolved()))
            maya.mel.eval('putenv MAYA_SCRIPT_PATH "%s"' % newScriptPath)
Пример #2
0
def setupCGMScriptPaths():
    thisFile = cgmPath.Path(__file__)
    #thisPath = os.sep.join(__file__.split(os.sep)[:-1])
    thisPath = thisFile.up().osPath()
    
    mayaScriptPaths = map( cgmPath.Path, maya.mel.eval( 'getenv MAYA_SCRIPT_PATH' ).split( os.pathsep ) )
    mayaScriptPathsSet = set( mayaScriptPaths )
    _paths = [os.path.join('cgm','mel','zooPy'),
              os.path.join('cgm','mel'),
              os.path.join('cgm','images'),
              os.path.join('cgm','lib','zoo'),
              os.path.join('cgm','lib','zoo','zooMel'),
              os.path.join('cgm','lib','zoo','zooPy'),     
	          os.path.join('cgm','core','mel'),
              'Red9']
    
    for path in _paths:
        fullPath = cgmPath.Path( os.path.join(thisPath, path) )
        if fullPath not in mayaScriptPathsSet:
            log.info("setupCGMScriptPaths>> Path not found. Appending: {0}".format(fullPath))            
            mayaScriptPaths.append( cgmPath.Path(fullPath.asFriendly()) )
            mayaScriptPaths.extend( fullPath.dirs( recursive=True ) )

            mayaScriptPaths = mUI.removeDupes( mayaScriptPaths )
            newScriptPath = os.pathsep.join( [ p for p in mayaScriptPaths ] )
            #for p in mayaScriptPaths:
                #print ("{0} >> {1}".format(p,p.unresolved()))
            maya.mel.eval( 'putenv MAYA_SCRIPT_PATH "%s"' % newScriptPath )
Пример #3
0
def setupCGMPlugins():
    thisFile = Path( __file__ )
    thisPath = thisFile.up()

    existingPlugPathStr = maya.mel.eval( 'getenv MAYA_PLUG_IN_PATH;' )
    existingPlugPaths = map( Path, existingPlugPathStr.split( os.pathsep ) )
    existingPlugPathsSet = set( existingPlugPaths )

    cgmPyPath = thisPath / 'cgm/plugins'

    if cgmPyPath not in existingPlugPathsSet:
        existingPlugPaths.append( cgmPyPath )

        existingPlugPaths = mUI.removeDupes( existingPlugPaths )
        newPlugPathStr = os.pathsep.join( [ p.unresolved() for p in existingPlugPaths ] )

        maya.mel.eval( 'putenv MAYA_PLUG_IN_PATH "%s";' % newPlugPathStr )
Пример #4
0
def setupCGMScriptPaths():
    thisFile = Path( __file__ )
    thisPath = thisFile.up()

    mayaScriptPaths = map( Path, maya.mel.eval( 'getenv MAYA_SCRIPT_PATH' ).split( os.pathsep ) )
    mayaScriptPathsSet = set( mayaScriptPaths )

    for path in '/cgm/mel','/cgm/images','/cgm/lib/zoo','/Red9':
        fullPath = thisPath / path
        if fullPath not in mayaScriptPathsSet:
            mayaScriptPaths.append( fullPath )
            mayaScriptPaths.extend( fullPath.dirs( recursive=True ) )

            mayaScriptPaths = mUI.removeDupes( mayaScriptPaths )
            newScriptPath = os.pathsep.join( [ p.unresolved() for p in mayaScriptPaths ] )

            maya.mel.eval( 'putenv MAYA_SCRIPT_PATH "%s"' % newScriptPath )
Пример #5
0
def setupCGMPlugins():
    thisFile = cgmPath.Path( __file__ )
    thisPath = thisFile.up().osPath()

    existingPlugPathStr = maya.mel.eval( 'getenv MAYA_PLUG_IN_PATH;' )
    existingPlugPaths = map( cgmPath.Path, existingPlugPathStr.split( os.pathsep ) )
    existingPlugPathsSet = set( existingPlugPaths )

    #cgmPyPath = thisPath / 'cgm/plugins'
    cgmPyPath = cgmPath.Path( os.path.join(thisPath, 'cgm','plugins') )
    if cgmPyPath not in existingPlugPathsSet:
        log.info("setupCGMPlugins>> cgmPyPath not found. Appending: {0}".format(cgmPyPath))            
        existingPlugPaths.append( cgmPyPath )

        existingPlugPaths = mUI.removeDupes( existingPlugPaths )
        newPlugPathStr = os.pathsep.join( [ p for p in existingPlugPaths ] )
	for p in existingPlugPaths:
	    print p
        maya.mel.eval( 'putenv MAYA_PLUG_IN_PATH "%s";' % newPlugPathStr )
Пример #6
0
def setupCGMPlugins():
    thisFile = cgmPath.Path(__file__)
    thisPath = thisFile.up().osPath()

    existingPlugPathStr = maya.mel.eval('getenv MAYA_PLUG_IN_PATH;')
    existingPlugPaths = map(cgmPath.Path,
                            existingPlugPathStr.split(os.pathsep))
    existingPlugPathsSet = set(existingPlugPaths)

    #cgmPyPath = thisPath / 'cgm/plugins'
    cgmPyPath = cgmPath.Path(os.path.join(thisPath, 'cgm', 'plugins'))
    if cgmPyPath not in existingPlugPathsSet:
        log.info(
            "setupCGMPlugins>> cgmPyPath not found. Appending: {0}".format(
                cgmPyPath))
        existingPlugPaths.append(cgmPyPath)

        existingPlugPaths = mUI.removeDupes(existingPlugPaths)
        newPlugPathStr = os.pathsep.join([p for p in existingPlugPaths])
        for p in existingPlugPaths:
            print p
        maya.mel.eval('putenv MAYA_PLUG_IN_PATH "%s";' % newPlugPathStr)