Blender Git Loki

Git Commits -> Revision 87cc890

Revision 87cc890 by Bastien Montagne (master)
December 21, 2013, 16:44 (GMT)
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: https://developer.blender.org/D61

Commit Details:

Full Hash: 87cc890aef53c4660448b1125dc0c40a187ae1f2
Parent Commit: f72b86d
Lines Changed: +1270, -939

11 Modified Paths:

/source/blender/blenkernel/BKE_unit.h (+1, -1) (Diff)
/source/blender/blenkernel/intern/unit.c (+21, -22) (Diff)
/source/blender/editors/animation/anim_markers.c (+7, -3) (Diff)
/source/blender/editors/include/ED_numinput.h (+32, -23) (Diff)
/source/blender/editors/mesh/editmesh_bevel.c (+77, -46) (Diff)
/source/blender/editors/mesh/editmesh_inset.c (+144, -111) (Diff)
/source/blender/editors/mesh/editmesh_loopcut.c (+146, -103) (Diff)
/source/blender/editors/transform/transform.c (+551, -423) (Diff)
/source/blender/editors/util/CMakeLists.txt (+5, -0) (Diff)
/source/blender/editors/util/numinput.c (+282, -207) (Diff)
/source/blender/editors/util/SConscript (+4, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021