From 36c273b1f7c65a759f77c8ed42b65b878dbb09da Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 16 Sep 2010 04:19:22 +0000 Subject: - bone roll now in degrees not radians. - rna buttons with units set now use the units base value for snapping. - bone head/tail radius could be set negative. matt: removed a check in ui_is_but_unit() which made angle buttons return false, what was this for? --- source/blender/blenkernel/intern/unit.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/unit.c') diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 963cfdbea1b..36a4cfea7a0 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -24,6 +24,8 @@ #include #include #include +#include "BKE_unit.h" + #ifdef WIN32 #define _USE_MATH_DEFINES #endif @@ -31,6 +33,7 @@ #include "BLI_winstuff.h" + #define TEMP_STR_SIZE 256 #define SEP_CHR '#' @@ -127,7 +130,8 @@ static struct bUnitDef buNaturalRotDef[] = { }; static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, sizeof(buNaturalRotDef)/sizeof(bUnitDef)}; -#define UNIT_SYSTEM_MAX 3 +#define UNIT_SYSTEM_TOT (((sizeof(bUnitSystems) / 8) / sizeof(void *)) - 1) + static struct bUnitCollection *bUnitSystems[][8] = { {0,0,0,0,0,&buNaturalRotCollection,&buNaturalTimeCollecton,0}, {0,&buMetricLenCollecton, 0,0,0, &buNaturalRotCollection, &buNaturalTimeCollecton,0}, /* metric */ @@ -135,6 +139,8 @@ static struct bUnitCollection *bUnitSystems[][8] = { {0,0,0,0,0,0,0,0} }; + + /* internal, has some option not exposed */ static bUnitCollection *unit_get_system(int system, int type) { @@ -459,7 +465,7 @@ int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pre bUnitCollection *usys_iter; int system_iter; - for(system_iter= 0; system_iter= B_UNIT_MAXDEF || system < 0 || system > UNIT_SYSTEM_TOT); +} + + void bUnit_GetSystem(void **usys_pt, int *len, int system, int type) { bUnitCollection *usys = unit_get_system(system, type); -- cgit v1.2.3