From 5575ea829601f32d49fac81b53db6d41b47e8f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Wed, 21 Aug 2024 23:01:06 -0300 Subject: [PATCH] Polyline and Measure tool now use right-click to confirm input --- src/bonsai/bonsai/bim/module/model/wall.py | 8 ++++---- src/bonsai/bonsai/bim/module/project/operator.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index f72e61ce40..6e5f88de2d 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -439,14 +439,14 @@ class DrawPolylineWall(bpy.types.Operator): PolylineDecorator.set_input_panel(self.input_panel, self.input_type) tool.Blender.update_viewport() - if not self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER"}: + if not self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}: self.create_walls_from_polyline(context) PolylineDecorator.uninstall() tool.Snap.clear_polyline() tool.Blender.update_viewport() return {"FINISHED"} - if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER"}: + if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}: self.recalculate_inputs(context) tool.Snap.insert_polyline_point(float(self.input_panel["X"]), float(self.input_panel["Y"])) self.is_input_on = False @@ -460,13 +460,13 @@ class DrawPolylineWall(bpy.types.Operator): return {"PASS_THROUGH"} if self.is_input_on: - if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}: + if event.value == "RELEASE" and event.type in {"ESC"}: self.is_input_on = False self.input_type = "OFF" PolylineDecorator.set_input_panel(self.input_panel, self.input_type) tool.Blender.update_viewport() else: - if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}: + if event.value == "RELEASE" and event.type in {"ESC"}: PolylineDecorator.uninstall() tool.Snap.clear_polyline() tool.Blender.update_viewport() diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 24eb610d05..1731ee5dc9 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -2424,7 +2424,7 @@ class MeasureTool(bpy.types.Operator): PolylineDecorator.set_input_panel(self.input_panel, self.input_type) tool.Blender.update_viewport() - if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER"}: + if self.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}: self.recalculate_inputs(context) tool.Snap.insert_polyline_point( float(self.input_panel["X"]), float(self.input_panel["Y"]), float(self.input_panel["Z"]) @@ -2455,13 +2455,13 @@ class MeasureTool(bpy.types.Operator): return {"PASS_THROUGH"} if self.is_input_on: - if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}: + if event.value == "RELEASE" and event.type in {"ESC"}: self.is_input_on = False self.input_type = "OFF" PolylineDecorator.set_input_panel(self.input_panel, self.input_type) tool.Blender.update_viewport() else: - if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}: + if event.value == "RELEASE" and event.type in {"ESC"}: PolylineDecorator.uninstall() tool.Snap.clear_polyline() tool.Blender.update_viewport()