[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21023] branches/soc-2009-aligorith/source /blender: NLA SoC: Drawing + Editing Fixes

Joshua Leung aligorith at gmail.com
Sat Jun 20 06:02:51 CEST 2009


Revision: 21023
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21023
Author:   aligorith
Date:     2009-06-20 06:02:49 +0200 (Sat, 20 Jun 2009)

Log Message:
-----------
NLA SoC: Drawing + Editing Fixes

* Strips using the same action as the 'tweaking action' now get the error flag cleared after tweakmode is exited. (These strips draw with red shading)

* The direction in which strips get played (as a result of the 'reversed' option) now gets indicated on strips by the direction of the arrow text printed on each strip

* The active strip flag is now cleared after duplicating/splitting strips.

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c

Modified: branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c	2009-06-20 03:58:25 UTC (rev 21022)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c	2009-06-20 04:02:49 UTC (rev 21023)
@@ -648,7 +648,6 @@
 	/* if block is already in tweakmode, just leave, but we should report 
 	 * that this block is in tweakmode (as our returncode)
 	 */
-	// FIXME: hopefully the flag is correct!
 	if (adt->flag & ADT_NLA_EDIT_ON)
 		return 1;
 		
@@ -707,6 +706,7 @@
 /* Exit tweakmode for this AnimData block */
 void BKE_nla_tweakmode_exit (AnimData *adt)
 {
+	NlaStrip *strip;
 	NlaTrack *nlt;
 	
 	/* verify that data is valid */
@@ -719,9 +719,15 @@
 		
 	// TODO: need to sync the user-strip with the new state of the action!
 		
-	/* for all NLA-tracks, clear the 'disabled' flag */
-	for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next)
+	/* for all NLA-tracks, clear the 'disabled' flag
+	 * for all NLA-strips, clear the 'tweak-user' flag
+	 */
+	for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
 		nlt->flag &= ~NLATRACK_DISABLED;
+		
+		for (strip= nlt->strips.first; strip; strip= strip->next) 
+			strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER;
+	}
 	
 	/* handle AnimData level changes:
 	 *	- 'temporary' active action needs its usercount decreased, since we're removing this reference

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-06-20 03:58:25 UTC (rev 21022)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-06-20 04:02:49 UTC (rev 21023)
@@ -212,19 +212,25 @@
 /* add the relevant text to the cache of text-strings to draw in pixelspace */
 static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc)
 {
-	char str[256];
+	char str[256], dir[3];
 	rctf rect;
 	
+	/* 'dir' - direction that strip is played in */
+	if (strip->flag & NLASTRIP_FLAG_REVERSE)
+		sprintf(dir, "<-");
+	else
+		sprintf(dir, "->");
+	
 	/* for now, just init the string with fixed-formats */
 	switch (strip->type) {
 		case NLASTRIP_TYPE_TRANSITION: /* Transition */
-			sprintf(str, "%d | Transition | %.2f <-> %.2f", index, strip->start, strip->end);
+			sprintf(str, "%d | Transition | %.2f %s %.2f", index, strip->start, dir, strip->end);
 			break;
 		
 		case NLASTRIP_TYPE_CLIP:	/* Action-Clip (default) */
 		default:
 			if (strip->act)
-				sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end);
+				sprintf(str, "%d | Act: %s | %.2f %s %.2f", index, strip->act->id.name+2, strip->start, dir, strip->end);
 			else
 				sprintf(str, "%d | Act: <NONE>", index); // xxx... need a better format?
 			break;

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c	2009-06-20 03:58:25 UTC (rev 21022)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c	2009-06-20 04:02:49 UTC (rev 21023)
@@ -492,8 +492,8 @@
 					BKE_nlatrack_add_strip(track, nstrip);
 				}
 				
-				/* deselect the original */
-				strip->flag &= ~NLASTRIP_FLAG_SELECT;
+				/* deselect the original and the active flag */
+				strip->flag &= ~(NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE);
 				
 				done++;
 			}
@@ -666,6 +666,9 @@
 				
 				strip->actend= midaframe;
 				nstrip->actstart= midaframe;
+				
+				/* clear the active flag from the copy */
+				nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE;
 			}
 		}
 	}





More information about the Bf-blender-cvs mailing list