Blender Git Loki

Git Commits -> Revision 47983cc

August 14, 2014, 07:08 (GMT)
Fix T38722: Adding units in Imperial setting results in inconsistent values

Now always check for a default unit, and evaluate the whole expression in this "unit space". Not an ideal solution, but should handle most cases nicely (we can't address all possible corner cases anyway).

Note default unit is searched in current string first (bigger unit of current system wins), then in previous string.

Note this also replaces ',' by '+' in default separation between units, helps solving issues with parenthesis (e.g. (1'1")*2.5 would fail in existing code)!

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D340

Commit Details:

Full Hash: 47983ccec5bad1cceb34183aa00fcf31d500649e
Parent Commit: 630f343
Lines Changed: +56, -38

2 Modified Paths:

/source/blender/blenkernel/intern/unit.c (+52, -37) (Diff)
/tests/python/bl_pyapi_units.py (+4, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021