Bugfix: Units for time translate transforms (action/nla editors) was messed up
authorJoshua Leung <aligorith@gmail.com>
Mon, 16 Jun 2014 09:44:08 +0000 (21:44 +1200)
committerJoshua Leung <aligorith@gmail.com>
Mon, 16 Jun 2014 09:46:03 +0000 (21:46 +1200)
When autosnap mode was nearest frame or nearest marker, this was incorrectly
converting the units to seconds, making this display unusable for anything.

source/blender/editors/transform/transform.c

index ab0bc061c32767184f51c3f71480137ab3d7c225..33d52ec1a000fef12f5a9de733821d5b31e417cb 100644 (file)
@@ -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);
        }