def find_by_extension(extension): # type: (str) -> FileTranslator extension = extension.lstrip('.') for name in _cmds.translator(query=True, list=True): ext = _cmds.translator(query=True, extension=True) if ext == extension: return FileTranslator(name) return None
def save_as(project_code, tab_code, wdg_code): current_type = cmds.optionVar(q='defaultFileSaveType') current_ext = cmds.translator(str(current_type), q=True, filter=True) current_ext = current_ext.split(';')[0] current_checkin_widget = env_inst.get_check_tree(project_code, tab_code, wdg_code) current_checkin_widget.save_file( selected_objects=[False, { current_type: current_ext[2:] }])
def can_write(self): # type: () -> bool return _cmds.translator(self.name, query=True, writeSupport=True)
def can_read(self): # type: () -> bool return _cmds.translator(self.name, query=True, readSupport=True)
def extension(self): # type: () -> bool return _cmds.translator(self.name, query=True, extension=True)
def ls(): return [ FileTranslator(name) for name in _cmds.translator(query=True, list=True) ]
def getCacheOptions(): global _cacheOptions # Init on first use from "USD Export" translator. if _cacheOptions is None: _cacheOptions = cmds.translator('USD Export', query=True, do=True) return _cacheOptions