[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33687] trunk/blender/source/blender/ editors/space_graph/graph_select.c: Minor annoyance with graph editor selection:

Campbell Barton ideasman42 at gmail.com
Wed Dec 15 16:59:10 CET 2010


Revision: 33687
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33687
Author:   campbellbarton
Date:     2010-12-15 16:59:10 +0100 (Wed, 15 Dec 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_graph/graph_select.c

Modified: trunk/blender/source/blender/editors/space_graph/graph_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_select.c	2010-12-15 15:56:06 UTC (rev 33686)
+++ trunk/blender/source/blender/editors/space_graph/graph_select.c	2010-12-15 15:59:10 UTC (rev 33687)
@@ -955,6 +955,7 @@
 {
 	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 @@
 	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 @@
 	/* 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);





More information about the Bf-blender-cvs mailing list