Fix #3382. Minor regression in wall join refactor from d64c135

This commit is contained in:
Dion Moult
2023-07-06 11:45:01 +10:00
parent fd626e37a0
commit 0078d691d3
@@ -77,14 +77,15 @@ class JoinWall(bpy.types.Operator, tool.Ifc.Operator):
return {"FINISHED"} return {"FINISHED"}
if self.join_type in ("L", "V"): if self.join_type in ("L", "V"):
if len(selected_objs) == 2: if len(selected_objs) != 2:
another_selected_object = next(o for o in selected_objs if o != context.active_object) self.report({"ERROR"}, f"It requires 2 selected objects to do join of type {self.join_type}")
if self.join_type == "L": return {"CANCELLED"}
joiner.join_L(another_selected_object, context.active_object) another_selected_object = next(o for o in selected_objs if o != context.active_object)
elif self.join_type == "V": if self.join_type == "L":
joiner.join_V(another_selected_object, context.active_object) joiner.join_L(another_selected_object, context.active_object)
self.report({"ERROR"}, f"It requires 2 selected objects to do join of type {self.join_type}") elif self.join_type == "V":
return {"CANCELLED"} joiner.join_V(another_selected_object, context.active_object)
return {"FINISHED"}
if self.join_type == "T": if self.join_type == "T":
elements = [tool.Ifc.get_entity(o) for o in context.selected_objects] elements = [tool.Ifc.get_entity(o) for o in context.selected_objects]