示例#1
0
 def GetSettingsForOperation(self, operation):
     """GetSettingsForOperation(operation) -> list_of_FSettingEntry
     
     Implements FApplication.GetSettingsForOperation()
     
     """
     if (operation == IMPORT):
         return [FSettingEntry(*entry) for entry in FMax.__IMPORT_OPTIONS]
     elif (operation == EXPORT):
         return [FSettingEntry(*entry) for entry in FMax.__EXPORT_OPTIONS]
     elif (operation == RENDER):
         return [FSettingEntry(*entry) for entry in FMax.__RENDER_OPTIONS]
     else:
         return []
示例#2
0
 def GetSettingsForOperation(self, operation):
     """GetSettingsForOperation(operation) -> list_of_FSettingEntry
     
     Implements FApplication.GetSettingsForOperation()
     
     """
     if (operation == IMPORT):
         return []
     elif (operation == EXPORT):
         options = []
         for entry in FMaya.__EXPORT_OPTIONS:
             options.append(FSettingEntry(*entry))
         return options
     elif (operation == RENDER):
         options = []
         for entry in FMaya.__RENDER_OPTIONS:
             options.append(FSettingEntry(*entry))
         return options
     else:
         return []
示例#3
0
 def GetSettingsForOperation(self, operation):
     """GetSettingsForOperation(operation) -> list_of_FSettingEntry
     
     Implements FApplication.GetSettingsForOperation()
     
     """
     if (operation == VALIDATE):
         options = []
         for entry in CoherencyTest.__VALIDATE_OPTIONS:
             options.append(FSettingEntry(*entry))
         return options
     else:
         return []
示例#4
0
    def GetSettingsForOperation(self, operation):
        """GetSettingsForOperation(operation) -> list_of_FSettingEntry
        
        Implements FApplication.GetSettingsForOperation()
        
        """
        options = []
        
        # Retrieve the list of options for this operation.
        optionList = None
        if operation == IMPORT: optionList = FMaya_UIRender.__IMPORT_OPTIONS
        elif operation == EXPORT: optionList = FMaya_UIRender.__EXPORT_OPTIONS
        elif operation == RENDER: optionList = FMaya_UIRender.__RENDER_OPTIONS

        # Return a correctly-processed list of FSettingEntry's.
        if optionList != None:
            for entry in optionList:
                options.append(FSettingEntry(*entry))
        return options
示例#5
0
    def __init__(self, name, op, app):
        self.__shortName = name
        self.__name = "<" + op + "><" + app + ">" + name
        self.__settings = []

        filename = (name + "." + SETTING_EXT)
        filename = os.path.join(SETTINGS_DIR, op, app, filename)
        filename = os.path.normpath(filename)

        if (not os.path.isfile(filename)):
            print filename
            raise ValueError, "No such setting found for " + self.__name + "."

        file = open(filename)
        line = file.readline()
        while (line != ""):
            # remove the new line char and split as prettyName, command, value
            self.__settings.append(FSettingEntry(*((line[:-1]).split("\t"))))
            line = file.readline()
        file.close()