[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26941] trunk/blender/source/blender: bugfix [#21136] End frame And Cur Frame setting is broken with Metric/ Imperial units [26876]
Campbell Barton
ideasman42 at gmail.com
Mon Feb 15 22:07:16 CET 2010
Revision: 26941
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26941
Author: campbellbarton
Date: 2010-02-15 22:07:14 +0100 (Mon, 15 Feb 2010)
Log Message:
-----------
bugfix [#21136] End frame And Cur Frame setting is broken with Metric/Imperial units [26876]
and minor changes for unit.c, no functional change.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/unit.c
trunk/blender/source/blender/editors/interface/interface.c
Modified: trunk/blender/source/blender/blenkernel/intern/unit.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/unit.c 2010-02-15 20:41:39 UTC (rev 26940)
+++ trunk/blender/source/blender/blenkernel/intern/unit.c 2010-02-15 21:07:14 UTC (rev 26941)
@@ -24,8 +24,8 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#include <math.h>
-#include "BLI_math.h"
#include "BLI_winstuff.h"
#define TEMP_STR_SIZE 256
@@ -33,7 +33,7 @@
#define SEP_CHR '#'
#define SEP_STR "#"
-#define EUL 0.000001
+#define EPS 0.000001
/* define a single unit */
@@ -118,7 +118,7 @@
static struct bUnitDef buNaturalRotDef[] = {
- {"degree", "degrees", "°", NULL, "Degrees", M_PI/180.f, 0.0, B_UNIT_DEF_NONE},
+ {"degree", "degrees", "°", NULL, "Degrees", M_PI/180.0, 0.0, B_UNIT_DEF_NONE},
{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
};
static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, sizeof(buNaturalRotDef)/sizeof(bUnitDef)};
@@ -152,7 +152,7 @@
if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
continue;
- if (value_abs >= unit->scalar*(1.0-EUL)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
+ if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
return unit;
}
Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c 2010-02-15 20:41:39 UTC (rev 26940)
+++ trunk/blender/source/blender/editors/interface/interface.c 2010-02-15 21:07:14 UTC (rev 26941)
@@ -1253,7 +1253,11 @@
if (scene->unit.flag & USER_UNIT_ROT_RADIANS && unit_type == PROP_UNIT_ROTATION)
return 0;
-
+
+ /* for now disable time unit conversion */
+ if (unit_type == PROP_UNIT_TIME)
+ return 0;
+
if (scene->unit.system == USER_UNIT_NONE) {
if (unit_type != PROP_UNIT_ROTATION)
return 0;
More information about the Bf-blender-cvs
mailing list