Added better error handling when no meshes are in collection

This commit is contained in:
Colin Basnett
2026-01-15 17:38:05 -08:00
parent e50a964dd3
commit a8fc115b14

View File

@@ -289,7 +289,12 @@ class PSA_OT_export_collection(Operator, ExportHelper, PsaExportMixin):
if collection is None: if collection is None:
self.report({'ERROR'}, 'No collection found for export') self.report({'ERROR'}, 'No collection found for export')
return {'CANCELLED'} return {'CANCELLED'}
try:
import_objects = get_psk_input_objects_for_collection(collection) import_objects = get_psk_input_objects_for_collection(collection)
except RuntimeError as e:
self.report({'ERROR_INVALID_CONTEXT'}, str(e))
return {'CANCELLED'}
options = create_psa_export_options(context, import_objects.armature_objects, self) options = create_psa_export_options(context, import_objects.armature_objects, self)