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:
authorCampbell Barton <ideasman42@gmail.com>2010-12-15 18:59:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-15 18:59:10 +0300
commit53adab987044654f36d4c26906b19ae559a93fc1 (patch)
tree7c6b25026a8b0ab8ff66061034fbdbfdc60a4599 /source/blender/editors/space_graph
parent9129750787aedc51f80108ee4f6c1a0dbcf5a45d (diff)
Minor annoyance with graph editor selection:
Selecting graph keys would toggle channel selection if shift was held. this was annoying when selecting 2+ unselected keys to have the channel change color each click. Now set the channel based on the selection state of the point, as long as points are being selected the channel will stay selected too.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_select.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 4e42e199521..05fcb3c6bf8 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -955,6 +955,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
{
SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
tNearestVertInfo *nvi;
+ BezTriple *bezt= NULL;
/* find the beztriple that we're selecting, and the handle that was clicked on */
nvi = find_nearest_fcurve_vert(ac, mval);
@@ -984,8 +985,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
if ((curves_only == 0) && ((nvi->fcu->flag & FCURVE_PROTECTED)==0)) {
/* only if there's keyframe */
if (nvi->bezt) {
- BezTriple *bezt= nvi->bezt;
-
+ bezt= nvi->bezt; /* used to check bezt seletion is set */
/* depends on selection mode */
if (select_mode == SELECT_INVERT) {
/* keyframe - invert select of all */
@@ -1041,11 +1041,23 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
/* only change selection of channel when the visibility of keyframes doesn't depend on this */
if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0) {
/* select or deselect curve? */
- if (select_mode == SELECT_INVERT)
- nvi->fcu->flag ^= FCURVE_SELECTED;
- else if (select_mode == SELECT_ADD)
- nvi->fcu->flag |= FCURVE_SELECTED;
-
+
+ /* when a single point is selected then dont toggle channel selection */
+ if(bezt) {
+ if((bezt->f2|bezt->f1|bezt->f3) & SELECT) {
+ nvi->fcu->flag |= FCURVE_SELECTED;
+ }
+ else {
+ nvi->fcu->flag &= ~FCURVE_SELECTED;
+ }
+ }
+ else {
+ if (select_mode == SELECT_INVERT)
+ nvi->fcu->flag ^= FCURVE_SELECTED;
+ else if (select_mode == SELECT_ADD)
+ nvi->fcu->flag |= FCURVE_SELECTED;
+ }
+
/* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */
if (nvi->fcu->flag & FCURVE_SELECTED) {
int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY | ANIMFILTER_NODUPLIS);