diff --git a/object_print3d_utils/operators.py b/object_print3d_utils/operators.py index f1dd26842..0d0ec7b5f 100644 --- a/object_print3d_utils/operators.py +++ b/object_print3d_utils/operators.py @@ -706,6 +706,11 @@ class MESH_OT_print3d_scale_to_bounds(Operator): def calc_length(vecs): return max(((max(v[i] for v in vecs) - min(v[i] for v in vecs)), i) for i in range(3)) + #Make sure at least one object is selected + if not context.selected_objects: + self.report({'ERROR'}, "No objects selected") + return {'CANCELLED'} + if context.mode == 'EDIT_MESH': length, axis = calc_length( [Vector(v) @ obj.matrix_world for obj in [context.edit_object] for v in obj.bound_box]