Update object_print3d_utils/operators.py #105233
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user