Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-08-26 14:52:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-26 14:53:41 +0400
commitb198500c027231709686ed600cfeff8dde70d8cd (patch)
tree8f90e2b71b99c777df8b1d6a107f653500561855 /source/blender/editors
parent3dd5adeed14518ff8b21343d6269732aa36e1cee (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/editors')
-rw-r--r--source/blender/editors/interface/interface.c5
-rw-r--r--source/blender/editors/util/numinput.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 698d3f0a585..6981f90d644 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -51,6 +51,7 @@
#include "BKE_context.h"
#include "BKE_unit.h"
+#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_idprop.h"
@@ -1942,13 +1943,13 @@ static double ui_get_but_scale_unit(uiBut *but, double value)
UnitSettings *unit = but->block->unit;
int unit_type = uiButGetUnitType(but);
- /* Time unit is a bit special, not handled by bUnit_getScaleUnit() for now. */
+ /* Time unit is a bit special, not handled by BKE_scene_unit_scale() for now. */
if (unit_type == PROP_UNIT_TIME) { /* WARNING - using evil_C :| */
Scene *scene = CTX_data_scene(but->block->evil_C);
return FRA2TIME(value);
}
else {
- return bUnit_getScaleUnit(unit, RNA_SUBTYPE_UNIT_VALUE(unit_type), value);
+ return BKE_scene_unit_scale(unit, RNA_SUBTYPE_UNIT_VALUE(unit_type), value);
}
}
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 4e8f6df66e1..a154f12a786 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -33,6 +33,7 @@
#include "BLI_string_cursor_utf8.h"
#include "BKE_context.h"
+#include "BKE_scene.h"
#include "BKE_unit.h"
#include "DNA_scene_types.h"
@@ -98,7 +99,7 @@ void outputNumInput(NumInput *n, char *str, UnitSettings *unit_settings)
const short i = (n->flag & NUM_AFFECT_ALL && n->idx != j && !(n->val_flag[j] & NUM_EDITED)) ? 0 : j;
/* Use scale_length if needed! */
- const float fac = (float)bUnit_getScaleUnit(unit_settings, n->unit_type[j], 1.0);
+ const float fac = (float)BKE_scene_unit_scale(unit_settings, n->unit_type[j], 1.0);
if (n->val_flag[i] & NUM_EDITED) {
/* Get the best precision, allows us to draw '10.0001' as '10' instead! */
@@ -482,7 +483,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
const char *default_unit = NULL;
/* Use scale_length if needed! */
- const float fac = (float)bUnit_getScaleUnit(&sce->unit, n->unit_type[idx], 1.0);
+ const float fac = (float)BKE_scene_unit_scale(&sce->unit, n->unit_type[idx], 1.0);
/* Make radian default unit when needed. */
if (n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION)