diff --git a/src/bonsai/bonsai/bim/module/model/polyline.py b/src/bonsai/bonsai/bim/module/model/polyline.py index 16096c57c3..f0d118fcbe 100644 --- a/src/bonsai/bonsai/bim/module/model/polyline.py +++ b/src/bonsai/bonsai/bim/module/model/polyline.py @@ -124,20 +124,20 @@ class PolylineOperator: def choose_axis(self, event, x=True, y=True, z=False): if x: - if event.value == "PRESS" and event.type == "X": + 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 event.value == "PRESS" and event.type == "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 event.value == "PRESS" and event.type == "Z": + if not event.shift and event.value == "PRESS" and event.type == "Z": self.tool_state.axis_method = "Z" 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]) diff --git a/src/bonsai/bonsai/bim/module/model/wall.py b/src/bonsai/bonsai/bim/module/model/wall.py index 370b552cc4..70c198dea3 100644 --- a/src/bonsai/bonsai/bim/module/model/wall.py +++ b/src/bonsai/bonsai/bim/module/model/wall.py @@ -336,7 +336,6 @@ class DrawPolylineWall(bpy.types.Operator, PolylineOperator): self.choose_axis(event) - self.handle_snap_selection(context, event) if ( diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 0554a13404..beae6e990b 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -2394,7 +2394,7 @@ class MeasureTool(bpy.types.Operator, PolylineOperator): BACKSPACE: Remove Point X, Y, Z: Choose Axis S-X, S-Y, S-Z: Choose Plane - SHIFT: Lock axis + L: Lock axis """ def modal(self, context, event): @@ -2413,7 +2413,6 @@ class MeasureTool(bpy.types.Operator, PolylineOperator): self.choose_axis(event, z=True) - self.choose_plane(event) self.handle_snap_selection(context, event) diff --git a/src/bonsai/bonsai/tool/snap.py b/src/bonsai/bonsai/tool/snap.py index 448535228e..46ccaf44a5 100644 --- a/src/bonsai/bonsai/tool/snap.py +++ b/src/bonsai/bonsai/tool/snap.py @@ -185,7 +185,10 @@ class Snap(bonsai.core.tool.Snap): # Get axis that are closer than the stick factor threshold elegible_axis = [] + for axis in snap_axis: + if not axis: + continue rot_mat = Matrix.Rotation(math.radians(360 - axis), 3, pivot_axis) rot_intersection = rot_mat @ translated_intersection proximity = rot_intersection.y @@ -200,7 +203,8 @@ class Snap(bonsai.core.tool.Snap): # Get the elegible axis with the lowest proximity if elegible_axis: proximity, axis = sorted(elegible_axis)[0] - + else: + pass # If lock axis is on it will use the snap angle so there is no need to search for elegible axis if elegible_axis or tool_state.lock_axis: