Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-10-05 22:05:45 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-10-20 23:52:12 +0300
commit14d56b4217f857eb78239051593c2391f9227b99 (patch)
tree78a95bb113d68ea1ee69380acff9043a4cb4f4bb /source/blender/windowmanager/intern/wm_operators.c
parentcf8aa209678c4b35ed18c9d385d5346d400fe672 (diff)
UI: Add angle snapping to line gesture tools
This adds support for snapping for line gesture tool. It is implemented in the modal keymap as Snap, which is a toggle (similar to how snapping in the transform operator works). Right now it snaps the angle of the line to 15 degree increments, which is defined in code. This should be easy to expose in the UI in the future if we need to. Reviewed By: Severin Differential Revision: https://developer.blender.org/D9115
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index bbe2ff4b81a..5e4a45ea3be 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3806,6 +3806,7 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
{GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""},
{GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""},
{GESTURE_MODAL_MOVE, "MOVE", 0, "Move", ""},
+ {GESTURE_MODAL_SNAP, "SNAP", 0, "Snap", ""},
{0, NULL, 0, NULL, NULL},
};
@@ -3822,6 +3823,8 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_assign(keymap, "IMAGE_OT_sample_line");
WM_modalkeymap_assign(keymap, "PAINT_OT_weight_gradient");
WM_modalkeymap_assign(keymap, "MESH_OT_bisect");
+ WM_modalkeymap_assign(keymap, "PAINT_OT_mask_line_gesture");
+ WM_modalkeymap_assign(keymap, "SCULPT_OT_project_line_gesture");
}
/* box_select-like modal operators */
@@ -3870,8 +3873,6 @@ static void gesture_box_modal_keymap(wmKeyConfig *keyconf)
WM_modalkeymap_assign(keymap, "PAINT_OT_mask_box_gesture");
WM_modalkeymap_assign(keymap, "SCULPT_OT_face_set_box_gesture");
WM_modalkeymap_assign(keymap, "SCULPT_OT_trim_box_gesture");
- WM_modalkeymap_assign(keymap, "PAINT_OT_mask_line_gesture");
- WM_modalkeymap_assign(keymap, "SCULPT_OT_project_line_gesture");
WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border");
WM_modalkeymap_assign(keymap, "VIEW3D_OT_clip_border");
WM_modalkeymap_assign(keymap, "VIEW3D_OT_render_border");