From 348e48b49c5b0bf1c4be2ed0ff79f00ab8b0be12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Aliste?= Date: Tue, 10 Feb 2026 18:17:52 -0300 Subject: [PATCH] Add get_angle_snap_value() helper to tool/snap.py This function retrieves the angle snap increment from Blender's tool_settings.snap_angle_increment property, which was added in Blender 4.2. This allows users to configure the angle snap value through Blender's native UI instead of using hardcoded values. Co-Authored-By: Claude Opus 4.5 --- src/bonsai/bonsai/tool/snap.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bonsai/bonsai/tool/snap.py b/src/bonsai/bonsai/tool/snap.py index 5c538dfc43..7ee06cd44e 100644 --- a/src/bonsai/bonsai/tool/snap.py +++ b/src/bonsai/bonsai/tool/snap.py @@ -114,6 +114,15 @@ class Snap(bonsai.core.tool.Snap): return increment + @classmethod + def get_angle_snap_value(cls, context: bpy.types.Context) -> float: + """Get the angle snap increment from Blender's tool settings. + + :param context: Blender context + :return: Angle snap increment in degrees + """ + return context.scene.tool_settings.snap_angle_increment + @classmethod def get_snap_points_on_raycasted_face(cls, context, event, obj, face_index): matrix = obj.matrix_world.copy()