diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-11-08 18:12:38 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-11-08 18:12:38 +0300 |
commit | c3391d537b11c27b469369073414ca57fee1aca6 (patch) | |
tree | 3f9e149bddcc924b3c7ac6268e218e4c8253b759 | |
parent | 32f58c0a92cfc56e6986c073a83aac8afc97fba4 (diff) |
Fix T101894: only do FCurve-select if no keys have been touched previously
Change the behaviour of circle select on FCurves:
- Before any key is touched, the behaviour is as it was (key included in
circle-select area → select it; otherwise → select entire curve)
- If any key has been touched, an internal option
(`use_curve_selection`) is flipped and selecting the entire curve is
disallowed.
This ensures that once a key changes selection state, it's no longer
possible to select the entire curve. This allows dragging over keys and
subsequently drag over a keyless part of the curve.
Reviewed By: RiggingDojo, troopy28
Maniphest Tasks: T101894
Differential Revision: https://developer.blender.org/D16307
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 932ed417f21..3265dcbf0d1 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1061,6 +1061,12 @@ static int graph_circle_select_exec(bContext *C, wmOperator *op) /* Apply box_select action. */ const bool any_key_selection_changed = box_select_graphkeys( &ac, &rect_fl, BEZT_OK_REGION_CIRCLE, selectmode, incl_handles, &data); + if (any_key_selection_changed) { + /* If any key was selected at any time during this process, the entire-curve selection should + * be disabled. Otherwise, sliding over any keyless part of the curve will immediately cause + * the entire curve to be selected. */ + RNA_boolean_set(op->ptr, "use_curve_selection", false); + } const bool use_curve_selection = RNA_boolean_get(op->ptr, "use_curve_selection"); if (use_curve_selection && !any_key_selection_changed) { box_select_graphcurves(&ac, &rect_fl, BEZT_OK_REGION_CIRCLE, selectmode, incl_handles, &data); |