diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-13 11:37:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-13 11:37:41 +0400 |
commit | d916c25616b4f5038d9b17fb3eae9de377a2a9e5 (patch) | |
tree | 7950951cce9c469d40a67d4a121aa7452fa61643 /source/blender/editors/transform | |
parent | 127f19cac4378142dfcf1edd18e0e014f248270c (diff) |
- moved unit settings from user prefs into the scene.
- use the scene context for the unit settings since there isn't a better place for it currently.
- added 'chain' to imperial units
- set more rna props to be distances and angles.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1d4882c2da2..042e4a1941a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -3040,11 +3040,11 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) { applyAspectRatio(t, dvec); dist = VecLength(vec); - if(U.unit_system) { - int i, do_split= U.unit_flag & USER_UNIT_OPT_SPLIT ? 1:0; + if(t->scene->unit.system) { + int i, do_split= t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1:0; for(i=0; i<3; i++) - bUnit_AsString(&tvec[i*20], dvec[i]*U.unit_scale_length, 4, U.unit_system, B_UNIT_LENGTH, do_split, 1); + bUnit_AsString(&tvec[i*20], dvec[i]*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, do_split, 1); } else { sprintf(&tvec[0], "%.4f", dvec[0]); @@ -3053,8 +3053,8 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) { } } - if(U.unit_system) - bUnit_AsString(distvec, dist*U.unit_scale_length, 4, U.unit_system, B_UNIT_LENGTH, U.unit_flag & USER_UNIT_OPT_SPLIT, 0); + if(t->scene->unit.system) + bUnit_AsString(distvec, dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0); else if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */ sprintf(distvec, "%.4e", dist); else |