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')
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')
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' )
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' )