mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Fix #6160 where axis snapping in polyline tool were not working consistently
This commit is contained in:
@@ -627,25 +627,17 @@ class PolylineOperator:
|
|||||||
return is_valid
|
return is_valid
|
||||||
|
|
||||||
def choose_axis(self, event: bpy.types.Event, x: bool = True, y: bool = True, z: bool = False) -> None:
|
def choose_axis(self, event: bpy.types.Event, x: bool = True, y: bool = True, z: bool = False) -> None:
|
||||||
if x:
|
options = {"X", "Y"}
|
||||||
if not event.shift and event.value == "PRESS" and event.type == "X":
|
|
||||||
self.tool_state.axis_method = "X" if self.tool_state.axis_method != event.type else None
|
|
||||||
self.tool_state.lock_axis = False if self.tool_state.lock_axis else True
|
|
||||||
PolylineDecorator.update(event, self.tool_state, self.input_ui, self.snapping_points[0])
|
|
||||||
tool.Blender.update_viewport()
|
|
||||||
|
|
||||||
if y:
|
|
||||||
if not event.shift and event.value == "PRESS" and event.type == "Y":
|
|
||||||
self.tool_state.axis_method = "Y" if self.tool_state.axis_method != event.type else None
|
|
||||||
self.tool_state.lock_axis = False if self.tool_state.lock_axis else True
|
|
||||||
PolylineDecorator.update(event, self.tool_state, self.input_ui, self.snapping_points[0])
|
|
||||||
tool.Blender.update_viewport()
|
|
||||||
if z:
|
if z:
|
||||||
if not event.shift and event.value == "PRESS" and event.type == "Z":
|
options = {"X", "Y", "Z"}
|
||||||
self.tool_state.axis_method = "Z" if self.tool_state.axis_method != event.type else None
|
if not event.shift and event.value == "PRESS" and event.type in options:
|
||||||
self.tool_state.lock_axis = False if self.tool_state.lock_axis else True
|
self.tool_state.axis_method = event.type if self.tool_state.axis_method != event.type else None
|
||||||
PolylineDecorator.update(event, self.tool_state, self.input_ui, self.snapping_points[0])
|
if self.tool_state.axis_method is not None:
|
||||||
tool.Blender.update_viewport()
|
self.tool_state.lock_axis = True
|
||||||
|
else:
|
||||||
|
self.tool_state.lock_axis = False
|
||||||
|
PolylineDecorator.update(event, self.tool_state, self.input_ui, self.snapping_points[0])
|
||||||
|
tool.Blender.update_viewport()
|
||||||
|
|
||||||
def choose_plane(self, event: bpy.types.Event, x: bool = True, y: bool = True, z: bool = True) -> None:
|
def choose_plane(self, event: bpy.types.Event, x: bool = True, y: bool = True, z: bool = True) -> None:
|
||||||
if x:
|
if x:
|
||||||
|
|||||||
Reference in New Issue
Block a user