[Bf-blender-cvs] [2da911e6c06] temp-graph-select-changes: Make handle drag and selection consistent with other cases

Julian Eisel noreply at git.blender.org
Thu Oct 10 18:47:58 CEST 2019


Commit: 2da911e6c06bbd6e760c7b3d20eef9e976a3e06c
Author: Julian Eisel
Date:   Thu Oct 10 18:46:23 2019 +0200
Branches: temp-graph-select-changes
https://developer.blender.org/rB2da911e6c06bbd6e760c7b3d20eef9e976a3e06c

Make handle drag and selection consistent with other cases

When selecting a handle that wasn't selected previously, we deselect
others, when dragging an already selected handle, we move it, etc.

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

M	source/blender/editors/space_graph/graph_select.c

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

diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index c62674f0df1..c25c8022595 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1436,12 +1436,12 @@ static int mouse_graph_keys(bAnimContext *ac,
     wait_to_deselect_others = false;
   }
 
-  /* Special treatment here: If we click on a key, behavior should be as usual. However, when
-   * clicking a handle, we make sure it's the only selected item in that triple. That way you can
-   * still click+drag handles to select and move them in one go, even though the entire triple is
-   * selected after clicking the key to reveal the handles. */
-  if (wait_to_deselect_others && nvi && BEZT_ISSEL_ANY(nvi->bezt) &&
-      ((nvi->bezt->f2 & SELECT) || (nvi->hpoint != NEAREST_HANDLE_KEY))) {
+  const bool already_selected =
+      nvi && (((nvi->hpoint == NEAREST_HANDLE_KEY) && (nvi->bezt->f2 & SELECT)) ||
+              ((nvi->hpoint == NEAREST_HANDLE_LEFT) && (nvi->bezt->f1 & SELECT)) ||
+              ((nvi->hpoint == NEAREST_HANDLE_RIGHT) && (nvi->bezt->f3 & SELECT)));
+
+  if (wait_to_deselect_others && nvi && already_selected) {
     ret_val = OPERATOR_RUNNING_MODAL;
   }
   /* For replacing selection, if we have something to select, we have to clear existing selection.



More information about the Bf-blender-cvs mailing list