Esempio n. 1
0
 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
Esempio n. 2
0
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:]
        }])
Esempio n. 3
0
 def can_write(self):
     # type: () -> bool
     return _cmds.translator(self.name, query=True, writeSupport=True)
Esempio n. 4
0
 def can_read(self):
     # type: () -> bool
     return _cmds.translator(self.name, query=True, readSupport=True)
Esempio n. 5
0
 def extension(self):
     # type: () -> bool
     return _cmds.translator(self.name, query=True, extension=True)
Esempio n. 6
0
 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