def show_error(title, text): msg = QtWidgets.QMessageBox() msg.setParent(self.parent, self.parent_flags) msg.setIcon(QtWidgets.QMessageBox.Critical) msg.setText(text) msg.setWindowTitle(title) msg.show()
def import_material(): global material_library if not material_library: try: material_library = MaterialLibrary() except MaterialLibrary.InitError as e: msg = QtWidgets.QMessageBox(hou.qt.mainWindow()) msg.setIcon(QtWidgets.QMessageBox.Critical) msg.setText(e.msg) msg.setWindowTitle("Material Library initialization failed") msg.show() return window = MaterialLibraryWindow() window.show()