[Bf-blender-cvs] [37fce22] master: Bugfix: Units for time translate transforms (action/nla editors) was messed up

Joshua Leung noreply at git.blender.org
Mon Jun 16 11:46:54 CEST 2014


Commit: 37fce22201b4f6f7be3b130f3c46c2220312e6cb
Author: Joshua Leung
Date:   Mon Jun 16 21:44:08 2014 +1200
https://developer.blender.org/rB37fce22201b4f6f7be3b130f3c46c2220312e6cb

Bugfix: Units for time translate transforms (action/nla editors) was messed up

When autosnap mode was nearest frame or nearest marker, this was incorrectly
converting the units to seconds, making this display unusable for anything.

===================================================================

M	source/blender/editors/transform/transform.c

===================================================================

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ab0bc06..33d52ec 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -7342,13 +7342,17 @@ static void headerTimeTranslate(TransInfo *t, char str[MAX_INFO_LEN])
 			/* second step */
 			val = floorf((double)val / secf + 0.5);
 		}
-		else {
-			/* nearest frame/second/marker */
+		else if (autosnap == SACTSNAP_SECOND) {
+			/* nearest second */
 			val = (float)((double)val / secf);
 		}
 		
 		if (autosnap == SACTSNAP_FRAME)
 			BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%d.00 (%.4f)", (int)val, val);
+		else if (autosnap == SACTSNAP_SECOND)
+			BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%d.00 sec (%.4f)", (int)val, val);
+		else if (autosnap == SACTSNAP_TSTEP)
+			BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f sec", val);
 		else
 			BLI_snprintf(&tvec[0], NUM_STR_REP_LEN, "%.4f", val);
 	}




More information about the Bf-blender-cvs mailing list