mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
Polyline and Measure tool now use right-click to confirm input
This commit is contained in:
@@ -439,14 +439,14 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
tool.Blender.update_viewport()
|
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)
|
self.create_walls_from_polyline(context)
|
||||||
PolylineDecorator.uninstall()
|
PolylineDecorator.uninstall()
|
||||||
tool.Snap.clear_polyline()
|
tool.Snap.clear_polyline()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
return {"FINISHED"}
|
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)
|
self.recalculate_inputs(context)
|
||||||
tool.Snap.insert_polyline_point(float(self.input_panel["X"]), float(self.input_panel["Y"]))
|
tool.Snap.insert_polyline_point(float(self.input_panel["X"]), float(self.input_panel["Y"]))
|
||||||
self.is_input_on = False
|
self.is_input_on = False
|
||||||
@@ -460,13 +460,13 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
return {"PASS_THROUGH"}
|
return {"PASS_THROUGH"}
|
||||||
|
|
||||||
if self.is_input_on:
|
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.is_input_on = False
|
||||||
self.input_type = "OFF"
|
self.input_type = "OFF"
|
||||||
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
else:
|
else:
|
||||||
if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}:
|
if event.value == "RELEASE" and event.type in {"ESC"}:
|
||||||
PolylineDecorator.uninstall()
|
PolylineDecorator.uninstall()
|
||||||
tool.Snap.clear_polyline()
|
tool.Snap.clear_polyline()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|||||||
@@ -2424,7 +2424,7 @@ class MeasureTool(bpy.types.Operator):
|
|||||||
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
tool.Blender.update_viewport()
|
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)
|
self.recalculate_inputs(context)
|
||||||
tool.Snap.insert_polyline_point(
|
tool.Snap.insert_polyline_point(
|
||||||
float(self.input_panel["X"]), float(self.input_panel["Y"]), float(self.input_panel["Z"])
|
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"}
|
return {"PASS_THROUGH"}
|
||||||
|
|
||||||
if self.is_input_on:
|
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.is_input_on = False
|
||||||
self.input_type = "OFF"
|
self.input_type = "OFF"
|
||||||
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
PolylineDecorator.set_input_panel(self.input_panel, self.input_type)
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
else:
|
else:
|
||||||
if event.value == "RELEASE" and event.type in {"RIGHTMOUSE", "ESC"}:
|
if event.value == "RELEASE" and event.type in {"ESC"}:
|
||||||
PolylineDecorator.uninstall()
|
PolylineDecorator.uninstall()
|
||||||
tool.Snap.clear_polyline()
|
tool.Snap.clear_polyline()
|
||||||
tool.Blender.update_viewport()
|
tool.Blender.update_viewport()
|
||||||
|
|||||||
Reference in New Issue
Block a user