Ejemplo n.º 1
0
def setupZooToolBox():
    #all the files for zooToolBox should live in the same directory as this script, including plug-ins
    thisFile = Path(__file__)
    thisPath = thisFile.up()

    existingPlugPathStr = maya.mel.eval('getenv MAYA_PLUG_IN_PATH;')
    existingPlugPaths = existingPlugPathStr.split(';')

    newPlugPaths = []
    pathsAlreadyInList = set()

    zooPlugPathAdded = False
    for path in existingPlugPaths:
        path = Path(path)
        if path in pathsAlreadyInList:
            continue

        pathsAlreadyInList.add(path)
        newPlugPaths.append(path.unresolved())

        if path == thisPath:
            zooPlugPathAdded = True

    if not zooPlugPathAdded:
        newPlugPaths.append(thisPath)

    newPlugPathStr = ';'.join(newPlugPaths)

    maya.mel.eval('putenv MAYA_PLUG_IN_PATH "%s";' % newPlugPathStr)

    #now setup the dagMenuProc
    setupDagProcMenu()
Ejemplo n.º 2
0
def setupZooToolBox():
	#all the files for zooToolBox should live in the same directory as this script, including plug-ins
	thisFile = Path( __file__ )
	thisPath = thisFile.up()

	existingPlugPathStr = maya.mel.eval( 'getenv MAYA_PLUG_IN_PATH;' )
	existingPlugPaths = existingPlugPathStr.split( ';' )

	newPlugPaths = []
	pathsAlreadyInList = set()

	zooPlugPathAdded = False
	for path in existingPlugPaths:
		path = Path( path )
		if path in pathsAlreadyInList:
			continue

		pathsAlreadyInList.add( path )
		newPlugPaths.append( path.unresolved() )

		if path == thisPath:
			zooPlugPathAdded = True

	if not zooPlugPathAdded:
		newPlugPaths.append( thisPath )

	newPlugPathStr = ';'.join( newPlugPaths )

	maya.mel.eval( 'putenv MAYA_PLUG_IN_PATH "%s";' % newPlugPathStr )

	#now setup the dagMenuProc
	setupDagProcMenu()