Minor improvement to add error message when mirror elements called without a mirror axis.

This commit is contained in:
Dion Moult
2023-04-07 20:07:21 +10:00
parent 68b685f580
commit f321cc81c8
2 changed files with 14 additions and 1 deletions
@@ -429,6 +429,13 @@ class MirrorElements(bpy.types.Operator, tool.Ifc.Operator):
mirror.select_set(False)
if not context.selected_objects:
self.report(
{"INFO"},
"At least two objects must be selected: an object to be mirrored, and a mirror axis as the active object.",
)
return {"FINISHED"}
bpy.ops.bim.override_object_duplicate_move(is_interactive=False)
for obj in context.selected_objects:
@@ -582,7 +582,13 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
if self.active_material_usage == "LAYER2":
bpy.ops.bim.merge_wall()
else:
bpy.ops.bim.mirror_elements()
if len(bpy.context.selected_objects) == 1:
self.report(
{"INFO"},
"At least two objects must be selected: an object to be mirrored, and a mirror axis as the active object.",
)
else:
bpy.ops.bim.mirror_elements()
def hotkey_S_R(self):
if not bpy.context.selected_objects: