[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17355] branches/animsys2/source/blender: AnimSys2: More DopeSheet improvements

Joshua Leung aligorith at gmail.com
Fri Nov 7 10:47:26 CET 2008


Revision: 17355
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17355
Author:   aligorith
Date:     2008-11-07 10:47:25 +0100 (Fri, 07 Nov 2008)

Log Message:
-----------
AnimSys2: More DopeSheet improvements

* Made colours for Object and its sub-channels themeable colours (set by default to this bluish colour)

* Backdrops behind keyframe summary for Object and its subchannels now use the theme colours to help differentiate them a bit. This is still not enough (same applies to group keyframes), but it is a start!

* Auto-merge keyframes option now works. Also, transforming keyframes now validates the order of the keyframes too (as it should). 

Modified Paths:
--------------
    branches/animsys2/source/blender/include/BIF_resources.h
    branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
    branches/animsys2/source/blender/src/drawaction.c
    branches/animsys2/source/blender/src/resources.c
    branches/animsys2/source/blender/src/transform_conversions.c
    branches/animsys2/source/blender/src/usiblender.c

Modified: branches/animsys2/source/blender/include/BIF_resources.h
===================================================================
--- branches/animsys2/source/blender/include/BIF_resources.h	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/include/BIF_resources.h	2008-11-07 09:47:25 UTC (rev 17355)
@@ -528,6 +528,9 @@
 	TH_HANDLE_VERTEX,
 	TH_HANDLE_VERTEX_SELECT,
 	TH_HANDLE_VERTEX_SIZE,
+	
+	TH_DOPESHEET_CHANNELOB,
+	TH_DOPESHEET_CHANNELSUBOB,
 };
 /* XXX WARNING: previous is saved in file, so do not change order! */
 

Modified: branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_userdef_types.h	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/makesdna/DNA_userdef_types.h	2008-11-07 09:47:25 UTC (rev 17355)
@@ -90,7 +90,8 @@
 	char normal[4];
 	char bone_solid[4], bone_pose[4];
 	char strip[4], strip_select[4];
-	char cframe[4], pad[4];
+	char cframe[4];
+	char ds_channel[4], ds_subchannel[4]; // dopesheet
 	
 	char vertex_size, facedot_size;
 	char bpad[2]; 
@@ -105,7 +106,7 @@
 	char handle_vertex[4];
 	char handle_vertex_select[4];
 	char handle_vertex_size;
-	char hpad[7];
+	char hpad[3];
 } ThemeSpace;
 
 

Modified: branches/animsys2/source/blender/src/drawaction.c
===================================================================
--- branches/animsys2/source/blender/src/drawaction.c	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/src/drawaction.c	2008-11-07 09:47:25 UTC (rev 17355)
@@ -828,13 +828,13 @@
 				/* only used in dopesheet... */
 				if (ale->type == ACTTYPE_OBJECT) {
 					/* object channel - darker */
-					glColor3f(0.217f, 0.074f, 0.793f); // fixme... currently hardcoded!
+					BIF_ThemeColor(TH_DOPESHEET_CHANNELOB);
 					uiSetRoundBox((expand == ICON_TRIA_DOWN)? (1):(1|8));
 					gl_round_box(GL_POLYGON, x+offset,  yminc, (float)NAMEWIDTH, ymaxc, 8);
 				}
 				else {
 					/* sub-object folders - lighter */
-					glColor3f(0.375f, 0.264f, 0.825f); // fixme... currently hardcoded!
+					BIF_ThemeColor(TH_DOPESHEET_CHANNELSUBOB);
 					
 					offset += 7 * indent;
 					//glRectf(x+offset,  yminc, (float)NAMEWIDTH, ymaxc);
@@ -997,11 +997,15 @@
 	int act_start, act_end, dummy;
 	char col1[3], col2[3];
 	char col1a[3], col2a[3];
+	char col1b[3], col2b[3];
 	
 	BIF_GetThemeColor3ubv(TH_SHADE2, col2);
 	BIF_GetThemeColor3ubv(TH_HILITE, col1);
 	BIF_GetThemeColor3ubv(TH_GROUP, col2a);
 	BIF_GetThemeColor3ubv(TH_GROUP_ACTIVE, col1a);
+	
+	BIF_GetThemeColor3ubv(TH_DOPESHEET_CHANNELOB, col1b);
+	BIF_GetThemeColor3ubv(TH_DOPESHEET_CHANNELSUBOB, col2b);
 
 	/* get editor data */
 	data= get_action_context(&datatype);
@@ -1082,8 +1086,17 @@
 			if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_DOPESHEET)) {
 				gla2DDrawTranslatePt(di, G.v2d->cur.xmin, y, &frame1_x, &channel_y);
 				
-				// ALE_OB? what happens...
-				if (ale->datatype == ALE_GROUP) {
+				if (ale->type == ACTTYPE_OBJECT) {
+					// FIXME... how do we differentiate between the two modes?
+					if (sel) glColor4ub(col1b[0], col1b[1], col1b[2], 0x45); 
+					else glColor4ub(col1b[0], col1b[1], col1b[2], 0x22); 
+				}
+				else if (ELEM3(ale->type, ACTTYPE_FILLIPOD, ACTTYPE_FILLACTD, ACTTYPE_FILLCOND)) {
+					// FIXME... how do we differentiate between the two modes?
+					if (sel) glColor4ub(col2b[0], col2b[1], col2b[2], 0x45); 
+					else glColor4ub(col2b[0], col2b[1], col2b[2], 0x22); 
+				}
+				else if (ale->datatype == ALE_GROUP) {
 					if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
 					else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
 				}
@@ -1091,18 +1104,12 @@
 					if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
 					else glColor4ub(col2[0], col2[1], col2[2], 0x22);
 				}
+				
+				/* draw region twice: firstly backdrop, then the current range */
 				glRectf((float)frame1_x,  (float)channel_y-CHANNELHEIGHT/2,  (float)G.v2d->hor.xmax,  (float)channel_y+CHANNELHEIGHT/2);
 				
-				// ALE_OB? what happens...
-				if (ale->datatype == ALE_GROUP) {
-					if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22);
-					else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22);
-				}
-				else {
-					if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22);
-					else glColor4ub(col2[0], col2[1], col2[2], 0x22);
-				}
-				glRectf((float)act_start,  (float)channel_y-CHANNELHEIGHT/2,  (float)act_end,  (float)channel_y+CHANNELHEIGHT/2);
+				if (datatype == ACTCONT_ACTION)
+					glRectf((float)act_start,  (float)channel_y-CHANNELHEIGHT/2,  (float)act_end,  (float)channel_y+CHANNELHEIGHT/2);
 			}
 			else if (datatype == ACTCONT_SHAPEKEY) {
 				gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);

Modified: branches/animsys2/source/blender/src/resources.c
===================================================================
--- branches/animsys2/source/blender/src/resources.c	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/src/resources.c	2008-11-07 09:47:25 UTC (rev 17355)
@@ -313,6 +313,7 @@
 				cp= ts->transition; break;
 			case TH_SEQ_META:
 				cp= ts->meta; break;
+				
 			case TH_HANDLE_VERTEX:
 				cp= ts->handle_vertex;
 				break;
@@ -322,8 +323,14 @@
 			case TH_HANDLE_VERTEX_SIZE:
 				cp= &ts->handle_vertex_size;
 				break;
+				
+			case TH_DOPESHEET_CHANNELOB:
+				cp= ts->ds_channel;
+				break;
+			case TH_DOPESHEET_CHANNELSUBOB:
+				cp= ts->ds_subchannel;
+				break;
 			}
-
 		}
 	}
 	
@@ -530,6 +537,8 @@
 	SETCOL(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 255);
 	SETCOL(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
 	SETCOL(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
+	SETCOL(btheme->tact.ds_channel, 0x36, 0x13, 0xca, 255);
+	SETCOL(btheme->tact.ds_subchannel, 0x60, 0x43, 0xd2, 255);
 
 	/* space nla */
 	btheme->tnla= btheme->tv3d;
@@ -725,6 +734,8 @@
 			str += sprintf(str, "Channels Selected %%x%d|", TH_HILITE);
 			str += sprintf(str, "Channel Group %%x%d|", TH_GROUP);
 			str += sprintf(str, "Active Channel Group %%x%d|", TH_GROUP_ACTIVE);
+			str += sprintf(str, "DopeSheet Channel %%x%d|", TH_DOPESHEET_CHANNELOB);
+			str += sprintf(str, "DopeSheet Sub-Chanel %%x%d|", TH_DOPESHEET_CHANNELSUBOB);
 			str += sprintf(str, "Long Key %%x%d|", TH_STRIP);
 			str += sprintf(str, "Long Key selected %%x%d|", TH_STRIP_SELECT);
 			str += sprintf(str, "Current Frame %%x%d", TH_CFRAME);

Modified: branches/animsys2/source/blender/src/transform_conversions.c
===================================================================
--- branches/animsys2/source/blender/src/transform_conversions.c	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/src/transform_conversions.c	2008-11-07 09:47:25 UTC (rev 17355)
@@ -3910,6 +3910,34 @@
 			/* Do curve updates */
 			remake_action_ipos((bAction *)data);
 		}
+		else if (datatype == ACTCONT_DOPESHEET) {
+			ListBase act_data = {NULL, NULL};
+			bActListElem *ale;
+			short filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS);
+			
+			/* get channels to work on */
+			actdata_filter(&act_data, filter, data, datatype);
+			
+			/* these should all be ipo-blocks */
+			for (ale= act_data.first; ale; ale= ale->next) {
+				Ipo *ipo= ale->key_data;
+				IpoCurve *icu;
+				
+				if ( (G.saction->flag & SACTION_NOTRANSKEYCULL)==0 && 
+				     ((cancelled == 0) || (duplicate)) )
+				{
+					posttrans_ipo_clean(ipo);
+				}
+				
+				for (icu = ipo->curve.first; icu; icu=icu->next) {
+					sort_time_ipocurve(icu);
+					testhandles_ipocurve(icu);
+				}
+			}
+			
+			/* free temp memory */
+			BLI_freelistN(&act_data);
+		}
 		else if (datatype == ACTCONT_SHAPEKEY) {
 			/* fix up the Ipocurves and redraw stuff */
 			Key *key= (Key *)data;

Modified: branches/animsys2/source/blender/src/usiblender.c
===================================================================
--- branches/animsys2/source/blender/src/usiblender.c	2008-11-07 06:50:19 UTC (rev 17354)
+++ branches/animsys2/source/blender/src/usiblender.c	2008-11-07 09:47:25 UTC (rev 17355)
@@ -514,6 +514,16 @@
 		U.gp_manhattendist= 2;
 		U.gp_euclideandist= 15;
 	}
+	if ((G.main->versionfile < 248) || (G.main->versionfile == 248 && G.main->subversionfile < 3)) {
+		bTheme *btheme;
+		
+		/* 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);
+		}
+	}
 
 	/* GL Texture Garbage Collection (variable abused above!) */
 	if (U.textimeout == 0) {





More information about the Bf-blender-cvs mailing list