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 <noreply@anthropic.com>
This commit is contained in:
José Aliste
2026-02-10 18:17:52 -03:00
committed by Bruno Perdigão
parent 6bb8abdc5a
commit 348e48b49c
+9
View File
@@ -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()