From dc9abaa6583cf5f6d05ca433e454ec6c9634bb4d Mon Sep 17 00:00:00 2001 From: Jonathan Wells Date: Wed, 13 Mar 2024 22:22:55 +0100 Subject: [PATCH] Update object_print3d_utils/operators.py Fix for bug #82760 --- object_print3d_utils/operators.py | 5 +++++ 1 file changed, 5 insertions(+) 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] -- 2.30.2