1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2024-12-18 09:15:57 +01:00

Improved reporting of PSK import error when there is nothing selected to import

This commit is contained in:
Colin Basnett 2024-01-27 00:42:51 -08:00
parent ced03afafe
commit 0a7804b5ab
2 changed files with 4 additions and 3 deletions

View File

@ -107,6 +107,10 @@ class PSK_OT_import(Operator, ImportHelper):
options.should_import_shape_keys = self.should_import_shape_keys options.should_import_shape_keys = self.should_import_shape_keys
options.scale = self.scale options.scale = self.scale
if not options.should_import_mesh and not options.should_import_skeleton:
self.report({'ERROR'}, 'Nothing to import')
return {'CANCELLED'}
result = import_psk(psk, context, options) result = import_psk(psk, context, options)
if len(result.warnings): if len(result.warnings):

View File

@ -54,9 +54,6 @@ def import_psk(psk: Psk, context, options: PskImportOptions) -> PskImportResult:
armature_object = None armature_object = None
mesh_object = None mesh_object = None
if not options.should_import_mesh and not options.should_import_skeleton:
raise Exception('Nothing to import')
if options.should_import_skeleton: if options.should_import_skeleton:
# ARMATURE # ARMATURE
armature_data = bpy.data.armatures.new(options.name) armature_data = bpy.data.armatures.new(options.name)