[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20799] branches/soc-2009-aligorith/source /blender/blenkernel/intern/anim_sys.c: NLA SoC: Evaluation bugfixes

Joshua Leung aligorith at gmail.com
Thu Jun 11 04:14:59 CEST 2009


Revision: 20799
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20799
Author:   aligorith
Date:     2009-06-11 04:14:56 +0200 (Thu, 11 Jun 2009)

Log Message:
-----------
NLA SoC: Evaluation bugfixes

* Strip scaling was being evaluated in the wrong way, resulting in scaled strips not being played too fast (for lengthened strips) or too slow (shortened strips)

* Also, verified that the 'reversed' option works correctly (no changes needed to be made here)

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/blenkernel/intern/anim_sys.c

Modified: branches/soc-2009-aligorith/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/intern/anim_sys.c	2009-06-11 00:46:42 UTC (rev 20798)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/intern/anim_sys.c	2009-06-11 02:14:56 UTC (rev 20799)
@@ -591,23 +591,23 @@
 	float length, actlength, repeat, scale;
 	
 	/* get number of repeats */
-	if (strip->repeat == 0.0f) strip->repeat = 1.0f;
+	if (IS_EQ(strip->repeat, 0.0f)) strip->repeat = 1.0f;
 	repeat = strip->repeat;
 	
 	/* scaling */
-	if (strip->scale == 0.0f) strip->scale= 1.0f;
+	if (IS_EQ(strip->scale, 0.0f)) strip->scale= 1.0f;
 	scale = (float)fabs(strip->scale); /* scale must be positive - we've got a special flag for reversing */
 	
 	/* length of referenced action */
 	actlength = strip->actend - strip->actstart;
-	if (actlength == 0.0f) actlength = 1.0f;
+	if (IS_EQ(actlength, 0.0f)) actlength = 1.0f;
 	
 	/* length of strip */
-	length = repeat * scale * actlength;
+	length = strip->end - strip->start;
+	if (IS_EQ(length, 0.0f)) length= actlength * scale * repeat;
 	
 	/* reversed = play strip backwards */
 	if (strip->flag & NLASTRIP_FLAG_REVERSE) {
-		// FIXME: verify these 
 		/* invert = convert action-strip time to global time */
 		if (invert)
 			return length*(strip->actend - cframe)/(repeat*actlength) + strip->start;
@@ -651,7 +651,7 @@
 {
 	/* firstly, analytically generate values for influence and time (if applicable) */
 	if ((strip->flag & NLASTRIP_FLAG_USR_TIME) == 0)
-		strip->strip_time= nlastrip_get_frame(strip, ctime, 1); /* last arg '1' means current time to 'strip'/action time */
+		strip->strip_time= nlastrip_get_frame(strip, ctime, 0);
 	if ((strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) == 0)
 		strip->influence= nlastrip_get_influence(strip, ctime);
 	





More information about the Bf-blender-cvs mailing list