def instructions(): """ Format a text with app istructions Dynamically created from config data. This is useful to display informations on GUI. :return: An HTML text representing instructions """ txt_naming = ConfigReader.texture_naming_dict() text = "<b>Texture naming rules:</b><br>(put an underscore _ at the end of file name; " \ "you can enumerate textures using two digits after texture type without any other character" \ "<br> e.g. _normal01 or in general _normalXX)" \ "<br>" for key, value in txt_naming.iteritems(): text += "<br>- {0}: {1}".format(key, ', '.join(a for a in value['text'])) text += "<br>" text += "<br><b>File formats:</b>" text += "<br>Meshes:" text += ConfigReader.generate_file_filter() text += "<br>Textures:" text += ConfigReader.generate_texture_filter() return text
def get_files(self): """ Open a file dialog in order to choose files to upload """ f_dialog = QtGui.QFileDialog() f_dialog.setFileMode(QtGui.QFileDialog.ExistingFiles) f_dialog.setDirectory(os.getenv("USERPROFILE")) filters = ConfigReader.generate_file_filter( ) + " " + ConfigReader.generate_texture_filter() f_dialog.setNameFilter("Assets data ({})".format(filters)) f_dialog.selectNameFilter("{}".format(filters)) if f_dialog.exec_(): filenames = f_dialog.selectedFiles() self.ui.listWidget.addItems(filenames)