[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18886] branches/blender2.5/blender/source /blender: Graph Editor: Drawing tweaks for previous commit

Joshua Leung aligorith at gmail.com
Mon Feb 9 11:33:05 CET 2009


Revision: 18886
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18886
Author:   aligorith
Date:     2009-02-09 11:33:05 +0100 (Mon, 09 Feb 2009)

Log Message:
-----------
Graph Editor: Drawing tweaks for previous commit

* Group channels are drawn with better indention now
* Colors for group channels in Graph Editor are now initialised properly
* When selecting individual keyframes in Graph Editor, it is now possible to see which curve it belonged to, as the 'active' and 'selected' flags are set on that curve only.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/resources.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c
    branches/blender2.5/blender/source/blender/windowmanager/intern/wm_files.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/resources.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/resources.c	2009-02-09 10:04:11 UTC (rev 18885)
+++ branches/blender2.5/blender/source/blender/editors/interface/resources.c	2009-02-09 10:33:05 UTC (rev 18886)
@@ -452,6 +452,8 @@
 	
 	SETCOL(btheme->tipo.ds_channel, 	82, 96, 110, 255);
 	SETCOL(btheme->tipo.ds_subchannel,	124, 137, 150, 255);
+	SETCOL(btheme->tipo.group, 22, 112, 0, 255);
+	SETCOL(btheme->tipo.group_active, 125, 233, 96, 255);
 
 	/* space file */
 	/* to have something initialized */

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-02-09 10:04:11 UTC (rev 18885)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-02-09 10:33:05 UTC (rev 18886)
@@ -594,7 +594,7 @@
 					indent= 0;
 					special= -1;
 					
-					offset= (ale->id) ? 18 : 0;
+					offset= (ale->id) ? 16 : 0;
 					
 					/* only show expand if there are any channels */
 					if (agrp->channels.first) {

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	2009-02-09 10:04:11 UTC (rev 18885)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c	2009-02-09 10:33:05 UTC (rev 18886)
@@ -875,7 +875,7 @@
 					indent= 0;
 					special= -1;
 					
-					offset= (ale->id) ? 18 : 0;
+					offset= (ale->id) ? 16 : 0;
 					
 					/* only show expand if there are any channels */
 					if (agrp->channels.first) {

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c	2009-02-09 10:04:11 UTC (rev 18885)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c	2009-02-09 10:33:05 UTC (rev 18886)
@@ -121,7 +121,6 @@
 	test_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
 	
 	/* See if we should be selecting or deselecting */
-	// xxx check for curves too
 	if (test) {
 		for (ale= anim_data.first; ale; ale= ale->next) {
 			if (ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, test_cb, NULL)) {
@@ -135,9 +134,21 @@
 	sel_cb= ANIM_editkeyframes_select(sel);
 	
 	/* Now set the flags */
-	// xxx check for curves too
-	for (ale= anim_data.first; ale; ale= ale->next) 
+	for (ale= anim_data.first; ale; ale= ale->next) {
+		FCurve *fcu= (FCurve *)ale->key_data;
+		
+		/* Keyframes First */
 		ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL);
+		
+		/* Curve Selection too */
+		if (sel == SELECT_ADD)
+			fcu->flag |= FCURVE_SELECTED;
+		else if (sel == SELECT_SUBTRACT)
+			fcu->flag &= ~FCURVE_SELECTED;
+		else
+			fcu->flag ^= FCURVE_SELECTED;
+		fcu->flag &= ~FCURVE_ACTIVE;
+	}
 	
 	/* Cleanup */
 	BLI_freelistN(&anim_data);
@@ -664,12 +675,6 @@
 		selectmode= SELECT_ADD;
 	}
 	
-	/* select or deselect? */
-	if (selectmode == SELECT_ADD)
-		fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED);
-	else if (selectmode == SELECT_INVERT)
-		fcu->flag ^= (FCURVE_ACTIVE|FCURVE_SELECTED);
-	
 	/* if we're selecting points too */
 	if ( ((fcu->flag & FCURVE_PROTECTED)==0) /*|| (curvesonly == 0) */) {
 		/* only if there's keyframe */
@@ -712,6 +717,18 @@
 			}
 		}
 	}
+	
+	/* select or deselect curve? */
+	if (selectmode == SELECT_INVERT) {
+		fcu->flag ^= FCURVE_SELECTED;
+		
+		if (fcu->flag & FCURVE_SELECTED)
+			fcu->flag |= FCURVE_ACTIVE;
+		else
+			fcu->flag &= ~FCURVE_ACTIVE;
+	}
+	else if (selectmode == SELECT_ADD)
+		fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED);
 }
 
 /* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */

Modified: branches/blender2.5/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- branches/blender2.5/blender/source/blender/windowmanager/intern/wm_files.c	2009-02-09 10:04:11 UTC (rev 18885)
+++ branches/blender2.5/blender/source/blender/windowmanager/intern/wm_files.c	2009-02-09 10:33:05 UTC (rev 18886)
@@ -331,12 +331,15 @@
 		/* adjust themes */
 		for (btheme= U.themes.first; btheme; btheme= btheme->next) {
 			/* DopeSheet - (Object) Channel color */
-			SETCOL(btheme->tact.ds_channel, 0x36, 0x13, 0xca, 255);
-			SETCOL(btheme->tact.ds_subchannel, 0x60, 0x43, 0xd2, 255);
+			SETCOL(btheme->tact.ds_channel, 	82, 96, 110, 255);
+			SETCOL(btheme->tact.ds_subchannel,	124, 137, 150, 255);
 			
 			/* Graph Editor - (Object) Channel color */
-			SETCOL(btheme->tipo.ds_channel, 0x36, 0x13, 0xca, 255);
-			SETCOL(btheme->tipo.ds_subchannel, 0x60, 0x43, 0xd2, 255);
+			SETCOL(btheme->tipo.ds_channel, 	82, 96, 110, 255);
+			SETCOL(btheme->tipo.ds_subchannel,	124, 137, 150, 255);
+			/* Graph Editor - Group Channel color */
+			SETCOL(btheme->tipo.group, 22, 112, 0, 255);
+			SETCOL(btheme->tipo.group_active, 125, 233, 96, 255);
 		}
 		
 		/* adjust grease-pencil distances */





More information about the Bf-blender-cvs mailing list