Exemplo n.º 1
0
def openFile(filepath, silent=False):
    filepath = Path(filepath)
    ext = filepath.getExtension().lower()
    if ext == 'ma' or ext == 'mb':
        mel.saveChanges('file -f -prompt %d -o "%s"' % (silent, filepath))
        mel.addRecentFile(
            filepath,
            'mayaAscii' if Path(filepath).hasExtension('ma') else 'mayaBinary')
Exemplo n.º 2
0
def importFile(filepath, silent=False):
    filepath = Path(filepath)
    ext = filepath.getExtension().lower()
    if ext == 'ma' or ext == 'mb':
        cmd.file(filepath,
                 i=True,
                 prompt=silent,
                 rpr='__',
                 type='mayaAscii',
                 pr=True,
                 loadReferenceDepth='all')
Exemplo n.º 3
0
    def __call__(self, echo=False):
        m = mel
        if echo:
            m = melecho

        fp = Path("%TEMP%/cmdQueue.mel")
        f = open(fp, 'w')
        f.writelines('%s;\n' % l for l in self)
        f.close()
        print fp

        m.source(fp)
Exemplo n.º 4
0
def referenceFile(filepath, namespace, silent=False):
    filepath = Path(filepath)
    cmd.file(filepath, r=True, prompt=silent, namespace=namespace)
Exemplo n.º 5
0
def importFile( filepath, silent=False ):
	filepath = Path( filepath )
	ext = filepath.getExtension().lower()
	if ext == 'ma' or ext == 'mb':
		cmd.file( filepath, i=True, prompt=silent, rpr='__', type='mayaAscii', pr=True, loadReferenceDepth='all' )
Exemplo n.º 6
0
def openFile( filepath, silent=False ):
	filepath = Path( filepath )
	ext = filepath.getExtension().lower()
	if ext == 'ma' or ext == 'mb':
		mel.saveChanges( 'file -f -prompt %d -o "%s"' % (silent, filepath) )
		mel.addRecentFile( filepath, 'mayaAscii' if Path( filepath ).hasExtension( 'ma' ) else 'mayaBinary' )