From 449331cd00248ae666f448070a572e284e78e64d Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Tue, 22 Nov 2022 12:57:44 -0800 Subject: [PATCH] Fixed a bug where certain material errors would not display correctly --- io_scene_psk_psa/psk/exporter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/io_scene_psk_psa/psk/exporter.py b/io_scene_psk_psa/psk/exporter.py index 7f55199..eac69c6 100644 --- a/io_scene_psk_psa/psk/exporter.py +++ b/io_scene_psk_psa/psk/exporter.py @@ -161,7 +161,12 @@ class PskExportOperator(Operator, ExportHelper): # Populate bone groups list. populate_bone_group_list(input_objects.armature_object, pg.bone_group_list) - populate_material_list(input_objects.mesh_objects, pg.material_list) + + try: + populate_material_list(input_objects.mesh_objects, pg.material_list) + except RuntimeError as e: + self.report({'ERROR_INVALID_CONTEXT'}, str(e)) + return {'CANCELLED'} context.window_manager.fileselect_add(self)