Commit Graph

85 Commits

Author SHA1 Message Date
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
e505203e8d Units: Add milligrams for mass
Avoids having small values displayed as "0kg".
2014-01-04 04:22:20 +01:00
4915706df6 Revert "Units: Make grams base unit for mass"
This reverts commit ead6d397fd.
2014-01-04 04:22:20 +01:00
ead6d397fd Units: Make grams base unit for mass 2013-12-31 18:10:30 +01:00
87cc890aef 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
2013-12-21 17:44:48 +01:00
dde5e5ce25 User Interface: Align number buttons labels to the left, number right 2013-12-11 21:27:13 +11:00
63caaa2b12 Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
2013-11-26 06:39:14 +11:00
1a0fed9ee0 More fix for this stupid uppercase-to-lowercase convertion code... Thanks to Lockal for noting this! 2013-11-16 15:34:47 +01:00
d27f8103dd Fix [#37393] Input dimensions are case sensitive in the property panel, uppercase input is misinterpreted
Typo in lowercasing code!
2013-11-10 19:51:44 +00:00
5ef717bec6 [#37327] Inconsistent numeric input conversion.
Issue was actually that micrometer was not drawing correctly (from r58165), reverted that fix and instead use utf8 drawing for editmode metrics when using a unit system (we already had a similar hack for surfaces and volumes, anyway).
2013-11-08 11:25:50 +00:00
991459d0ce fix [#36090] Blender displays strange symbol in edge length 2013-07-11 05:11:10 +00:00
46eb79c862 units: display 0.5mm rather then 500um, nicer when dealing with very small sizes but not microscopic. 2013-05-30 21:17:50 +00:00
2b2099cd51 Fix #34875: 0 digits of precision was not supported for FloatProperty, now
you can specify precision=0 for this, and use -1 for the default 2.
2013-04-08 18:55:08 +00:00
ffc8ecc587 use BLI_strncpy_rlen() rather then BLI_snprintf() when no formatting is needed.
also replace sprintf with strcpy when no formatting is done.
2013-03-14 10:39:18 +00:00
5162a155af Fix #34481: camera focal length and sensor size did not use units yet, now they do.
I've added a separate camera unit type. It's a bit strange to have an exception for
this but it ensures units are shown in familiar millimeters and it also ensures
backwards compatibility.
2013-03-13 17:16:49 +00:00
25c9b56c5a Suppress more uncommon units. 2013-02-11 07:12:15 +00:00
971fca48ca supress Hectograms from being used when displaying weight units since they are not so common. 2013-02-11 01:14:45 +00:00
f213ae0b19 style cleanup 2012-11-01 09:54:00 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
715edceb42 spelling cleanup: metre -> er 2012-07-04 12:56:58 +00:00
32478997ec style cleanup 2012-06-27 18:29:47 +00:00
57b488574a style cleanup: comma placement 2012-05-23 22:45:39 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
f627745053 aparently yards are not used a lot, suppress their use in button display (input still knows about them) - was reported as a bug.
also fix minor rip bug where active selection was lost.
2012-04-20 14:59:24 +00:00
a73d0d3e72 code cleanup: dont include BLI_winstuff.h on non windows systems, also cleanup some defines/includes for windows. 2012-04-15 07:54:07 +00:00
3c6239f8be fix for unit system incorrectly replacint 'um' (unicode 'u'). with meters.
result was editing number buttons with um would give a python error.
2012-04-10 02:51:24 +00:00
6fef7f1c32 style cleanup: unit code 2012-03-10 14:20:55 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
31d2ee9bf7 style cleanup, brackets in else/if, some indentation. 2012-03-06 18:40:15 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
53fece44cf style cleanup for blenkernel, no functional changes. 2012-02-23 02:17:50 +00:00
96bd647c4f split some >120 lines, no functional changes 2011-12-21 22:56:06 +00:00
d227471b72 Fix #28663: All "unit" properties show a value of 0 (on WinXP&MinGW&scons)
Use %g instead of %lg due to %g is supposed to be used for doubles and %lg confuses mingw at all
2011-12-07 17:23:45 +00:00
33accdb725 use (const char*) rather than (char*) where possible.
also removed some unused function definitons.
2011-11-05 11:04:28 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
c912af36ca Fix #28663: All "unit" properties show a value of 0 (on WinXP&MinGW&scons)
Initially problem was caused by updated version of mingw-runtime which
changed behavior of snprintf and vsnprintf so %lf isn't anymore valid
for doubles.

According to manpages, %f is a correct format for snprintf for doubles.
2011-09-16 10:03:08 +00:00
b3704f45c4 Fixes for snprintf usage:
* replace by BLI_snprintf in various places, note _snprintf on windows
  does not properly null terminate the string.
* fix overflow in sequencer proxy code due to buffer being smaller than
  specified size.
* fix some usage of snprintf as strcpy, this is will go wrong if the
  string contains % characters.
* remove BLI_dynstr_printf function in gpu module, use BLI_dynstr_appendf
2011-08-30 10:07:50 +00:00
99caa9470e fix [#28213] Imperial unit for 0.001 inches inconsistently displayed as mils and thous 2011-08-11 08:24:56 +00:00
a8185f4cc8 patch [#26978] Minor Spelling Mistakes in Editor Operators
+ some errors I noticed.
2011-04-19 10:35:24 +00:00
b84a6c4d7e use less verbose string formatting for units and interface. 2011-03-29 14:36:55 +00:00
Nathan Letwory
0ff06e21cd doxygen: blender/blenkernel tagged. 2011-02-27 20:40:57 +00:00
00c05c8404 Clean up headers a bit more. 2011-02-23 18:03:40 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
b27f52ce24 bugfix [#25154] .MXF files should be included as a known video file type in the sequencer
[#25159] Vertex locations dont read correctly and are not labeled correctly in the properties bar.

- non rna buttons can now have units set.
- calls with invalid units system now raises an assert().
- include .mxf in filter.
2010-12-10 04:10:21 +00:00