Update object_print3d_utils/operators.py #105233

Closed
Jonathan Wells wants to merge 1 commits from Jonathan-Wells/blender-addons:jonathan-wells-patch-2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit dc9abaa658 - Show all commits

View File

@ -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]