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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-12-21 20:11:43 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-12-21 20:44:48 +0400
commit87cc890aef53c4660448b1125dc0c40a187ae1f2 (patch)
tree5742d07986fa362b4f17590129dd8c5692cd51b7 /source/blender/blenkernel/BKE_unit.h
parentf72b86da8cab4bff482fc58095d14c97823fa39f (diff)
Support units in modal numinput
Summary: This completly changes the way modal numinput is handled. Now, edited expression is a string, which then gets unit- and py-evaluated to get a float value. We gain many power and flexibility, but lose a few "shortcuts" like '-' to negate, or '/' to inverse (if they are really needed, we still can add them with modifiers, like e.g. ctrl-/ or so). Features: - units (cm, ", deg, etc.). - basic operations from python/BKE_unit (+, *, **, etc.), and math constants and functions (pi, sin, etc.). - you can navigate in edited value (left/right key, ctrl to move by block) and insert/delete chars, e.g. to fix a typo without having to rewrite everything. - you can go to next/previous value with (ctrl-)TAB key. - As before, hitting backspace after having deleted all leading chars will first reset the edited value to init state, and on second press, the whole "modal numinput" editing will be cancelled, going back to usual transform with mouse. Notes: - Did not touch to how values are shown in header when modal numinput is not enabled (would do that in another commit), so this is still quite inconsistent. - Added back radian support in BKE_unit. - Added arcminute/arcsecond to BKE_unit. (those unit changes affect all angle UI controls, btw, so you can now enter radians or longitude/latitude values when in degrees units). Related to T37600. Reviewers: brecht, campbellbarton, carter2422 Reviewed By: brecht, campbellbarton, carter2422 Thanks everybody! Differential Revision: http://developer.blender.org/D61
Diffstat (limited to 'source/blender/blenkernel/BKE_unit.h')
-rw-r--r--source/blender/blenkernel/BKE_unit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
index 6b5ce5e1d21..133f3d0dfbc 100644
--- a/source/blender/blenkernel/BKE_unit.h
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -34,7 +34,7 @@ extern "C" {
/* in all cases the value is assumed to be scaled by the user preference */
/* humanly readable representation of a value in units (used for button drawing) */
-void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad);
+size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad);
/* replace units with values, used before python button evaluation */
int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type);