Improved reporting of PSK import error when there is nothing selected to import
This commit is contained in:
@@ -107,6 +107,10 @@ class PSK_OT_import(Operator, ImportHelper):
|
||||
options.should_import_shape_keys = self.should_import_shape_keys
|
||||
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)
|
||||
|
||||
if len(result.warnings):
|
||||
|
||||
@@ -54,9 +54,6 @@ def import_psk(psk: Psk, context, options: PskImportOptions) -> PskImportResult:
|
||||
armature_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:
|
||||
# ARMATURE
|
||||
armature_data = bpy.data.armatures.new(options.name)
|
||||
|
||||
Reference in New Issue
Block a user