Exemple #1
0
def getControlShapeFiles():
    dir = CONTROL_DIRECTORY
    if isinstance(dir, basestring):
        dir = Path(dir)

    if not isinstance(dir, Path) or not dir.exists():
        dir = Path(__file__).up()

    shapes = []
    if dir.exists():
        shapes = [f for f in dir.files() if f.hasExtension('shape')]

    if not shapes:
        searchPaths = map(Path, sys.path)
        searchPaths += map(Path,
                           os.environ.get('MAYA_SCRIPT_PATH', '').split(';'))
        searchPaths = removeDupes(searchPaths)

        for d in searchPaths:
            try:
                shapes += [f for f in d.files() if f.hasExtension('shape')]
            except WindowsError:
                continue

    return shapes
def _iterSkeletonPartScripts():
    for p in sys.path:
        p = Path(p)
        if 'maya' in p:
            for f in p.files():
                if f.hasExtension('py'):
                    if f.name().startswith(SKELETON_PART_SCRIPT_PREFIX):
                        yield f
def _iterRigPartScripts():
    for p in sys.path:
        p = Path(p)
        if 'maya' in p:  #
            for f in p.files():
                if f.hasExtension('py'):
                    if f.name().startswith(RIG_PART_SCRIPT_PREFIX):
                        yield f
def _iterSkeletonPartScripts():
	for p in sys.path:
		p = Path( p )
		if 'maya' in p:
			for f in p.files():
				if f.hasExtension( 'py' ):
					if f.name().startswith( SKELETON_PART_SCRIPT_PREFIX ):
						yield f
def _iterRigPartScripts():
	for p in sys.path:
		p = Path( p )
		if 'maya' in p:  #
			for f in p.files():
				if f.hasExtension( 'py' ):
					if f.name().startswith( RIG_PART_SCRIPT_PREFIX ):
						yield f
Exemple #6
0
def populateTestScripts():
    global TEST_SCRIPTS

    thisScriptDir = Path(__file__).up()
    pathsToSearch = sys.path[:] + [thisScriptDir]
    for pyPath in pathsToSearch:
        pyPath = Path(pyPath)
        if pyPath.isDir():
            for f in pyPath.files():
                if f.hasExtension('py'):
                    if f.name().startswith('devTest_'):
                        TEST_SCRIPTS[f] = []
def getControlShapeFiles():
	dir = CONTROL_DIRECTORY
	if isinstance( dir, basestring ):
		dir = Path( dir )

	if not isinstance( dir, Path ) or not dir.exists:
		dir = Path( __file__ ).up()

	shapes = []
	if dir.exists:
		shapes = [ f for f in dir.files() if f.hasExtension( 'shape' ) ]

	if not shapes:
		searchPaths = map( Path, sys.path )
		searchPaths += map( Path, os.environ.get( 'MAYA_SCRIPT_PATH', '' ).split( ';' ) )
		searchPaths = removeDupes( searchPaths )

		for d in searchPaths:
			try: shapes += [ f for f in d.files() if f.hasExtension( 'shape' ) ]
			except WindowsError: continue

	return shapes