Cleanup: minor changes & simplification to Align-XY

Also shorten text which didn't fit in the UI.
This commit is contained in:
Campbell Barton 2022-02-15 16:01:40 +11:00
parent e648555eb6
commit c924e2d52a
2 changed files with 3 additions and 6 deletions

View File

@ -757,8 +757,7 @@ class MESH_OT_print3d_align_to_xy(Operator):
else:
faces = [p for p in obj.data.polygons if p.select]
face_count = len(faces)
if face_count < 1:
if not faces:
skip_invalid.append(obj.name)
continue
@ -788,9 +787,7 @@ class MESH_OT_print3d_align_to_xy(Operator):
return {'FINISHED'}
def invoke(self, context, event):
if context.mode in {'EDIT_MESH', 'OBJECT'}:
pass
else:
if context.mode not in {'EDIT_MESH', 'OBJECT'}:
return {'CANCELLED'}
return self.execute(context)

View File

@ -116,7 +116,7 @@ class VIEW3D_PT_print3d_transform(View3DPrintPanel, Panel):
row.operator("mesh.print3d_scale_to_volume", text="Volume")
row.operator("mesh.print3d_scale_to_bounds", text="Bounds")
row = layout.row(align=True)
row.operator("mesh.print3d_align_to_xy", text="Align to XY Plane")
row.operator("mesh.print3d_align_to_xy", text="Align XY")
row.prop(print_3d, "use_alignxy_face_area")