mirror of
https://github.com/DarklightGames/io_scene_psk_psa.git
synced 2024-12-18 01:05:57 +01:00
Improved reporting of PSK import error when there is nothing selected to import
This commit is contained in:
parent
ced03afafe
commit
0a7804b5ab
@ -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):
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user