Abort export if SELECTED or SELECTED_WITH_CHILDREN is chosen but nothing is selected and warn user that hidden objects can't be selected.

This commit is contained in:
William Herald Snyder 2022-10-08 22:07:44 -04:00
parent b120b74cd4
commit ba762d9548
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,11 @@ class ExportMSH(Operator, ExportHelper):
def execute(self, context):
if 'SELECTED' in self.export_target and len(bpy.context.selected_objects) == 0:
raise Exception("{} was chosen, but you have not selected any objects. "
" Don't forget to unhide all the objects you wish to select!".format(self.export_target))
scene, armature_obj = create_scene(
generate_triangle_strips=self.generate_triangle_strips,
apply_modifiers=self.apply_modifiers,