diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-26 14:52:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-26 14:53:41 +0400 |
commit | b198500c027231709686ed600cfeff8dde70d8cd (patch) | |
tree | 8f90e2b71b99c777df8b1d6a107f653500561855 /source/blender/blenkernel/intern/unit.c | |
parent | 3dd5adeed14518ff8b21343d6269732aa36e1cee (diff) |
Move bUnit_getScaleUnit -> BKE_scene_unit_scale
unit.c intentionally doesn't include DNA or BKE headers (except its own)
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index cdaf72aa191..5a2c77b5619 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -37,12 +37,12 @@ #include "BKE_unit.h" /* own include */ -#include "DNA_scene_types.h" - #ifdef WIN32 # include "BLI_winstuff.h" #endif +/* no BKE or DNA includes! */ + #define TEMP_STR_SIZE 256 #define SEP_CHR '#' @@ -791,29 +791,6 @@ double bUnit_BaseScalar(int system, int type) return unit_default(usys)->scalar; } -double bUnit_getScaleUnit(UnitSettings *unit, const int unit_type, double value) -{ - if (unit->system == USER_UNIT_NONE) { - /* Never apply scale_length when not using a unit setting! */ - return value; - } - - switch (unit_type) { - case B_UNIT_LENGTH: - return value * (double)unit->scale_length; - case B_UNIT_CAMERA: - return value * (double)unit->scale_length; - case B_UNIT_AREA: - return value * pow(unit->scale_length, 2); - case B_UNIT_VOLUME: - return value * pow(unit->scale_length, 3); - case B_UNIT_MASS: - return value * pow(unit->scale_length, 3); - default: - return value; - } -} - /* external access */ bool bUnit_IsValid(int system, int type) { |