[Bf-blender-cvs] [e3e7543f304] tracking_tools: Tracking: Restore pre-tool behavior for tweak tool with RMB select

Sergey Sharybin noreply at git.blender.org
Fri May 13 10:33:38 CEST 2022


Commit: e3e7543f3042a54e5830b89efb9b35029cfb6993
Author: Sergey Sharybin
Date:   Fri May 13 10:25:50 2022 +0200
Branches: tracking_tools
https://developer.blender.org/rBe3e7543f3042a54e5830b89efb9b35029cfb6993

Tracking: Restore pre-tool behavior for tweak tool with RMB select

Make it an explicit option for operator to make it behave in a way which
is the most convenient for left mouse select, and do not use it for the
right mouse select.

===================================================================

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	source/blender/editors/space_clip/tracking_select.c

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 07f32cc8ce7..b9303cb5842 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -6666,7 +6666,11 @@ def km_clip_editor_tool_add_marker_tweak(params):
         {"items": [
             ("clip.change_frame", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
             ("clip.select", {"type": params.select_mouse, "value": 'PRESS'},
-             {"properties": [("extend", False), ("deselect_all", True)]}),
+             {"properties": [
+                 ("extend", False),
+                 ("deselect_all", True),
+                 ("activate_selected", params.select_mouse == 'LEFTMOUSE')]}
+             ),
             ("clip.slide_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
             ("clip.slide_plane_marker", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
             ("clip.add_marker_slide", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c
index 5b2a1b945e7..b922aeaa61e 100644
--- a/source/blender/editors/space_clip/tracking_select.c
+++ b/source/blender/editors/space_clip/tracking_select.c
@@ -402,14 +402,13 @@ static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
   SpaceClip *sc = CTX_wm_space_clip(C);
   ARegion *region = CTX_wm_region(C);
 
-  float co[2];
-  const bool extend = RNA_boolean_get(op->ptr, "extend");
-
   /* Special code which allows to slide a marker which belongs to currently selected but not yet
    * active track. If such track is found activate it and return pass-though so that marker slide
    * operator can be used immediately after.
-   * This logic makes it convenient to slide markers when left mouse selection is used. */
-  if (!extend) {
+   * This logic makes it convenient to slide markers when left mouse selection is used. Without it
+   * selection will be lost which causes inconvenience for the VFX artist. */
+  const bool activate_selected = RNA_boolean_get(op->ptr, "activate_selected");
+  if (activate_selected) {
     MovieTrackingTrack *track = tracking_find_slidable_track_in_proximity(C, event);
     if (track != NULL) {
       MovieClip *clip = ED_space_clip_get_clip(sc);
@@ -423,6 +422,7 @@ static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
     }
   }
 
+  float co[2];
   ED_clip_mouse_pos(sc, region, event->mval, co);
   RNA_float_set_array(op->ptr, "location", co);
 
@@ -452,6 +452,7 @@ void CLIP_OT_select(wmOperatorType *ot)
                          "Extend",
                          "Extend selection rather than clearing the existing selection");
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
   prop = RNA_def_boolean(ot->srna,
                          "deselect_all",
                          false,
@@ -459,6 +460,14 @@ void CLIP_OT_select(wmOperatorType *ot)
                          "Deselect all when nothing under the cursor");
   RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 
+  prop = RNA_def_boolean(
+      ot->srna,
+      "activate_selected",
+      0,
+      "Activate Selected",
+      "When selecting already selected track activate it and do not alter others selection");
+  RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
   RNA_def_float_vector(
       ot->srna,
       "location",



More information about the Bf-blender-cvs mailing list