Blender Git Loki

Git Commits -> Revision 45dbc38

Revision 45dbc38 by Hans Goudey (master)
June 1, 2020, 12:22 (GMT)
Fix T74552: Distribute negatives in number input

This applies a relatively simple solution for fixing some unintuitive
cases in unit handling.

Currently entering -1m50cm evaluates to -0.5m, and similarly 1'6"
evaulates to just half a foot. So effectively there's an implied + just
between the numbers, which is quite confusing.

This works by adding parentheses so the negative distributes to the
block of values before the next operator.

For example:
| Before | After |
| `-1m50cm + 1m -2m50cm` | `-(1m50cm) + 1m -(2m50cm)` |
| `-4m + 0.5 / -1.1` | `-(4m) + 0.5 / -(1.1)` |
| `-1'6"` | `-(1'6")` |
| `-1e-2cm` | `-(1e-2cm) ` |

Reviewed By: campbellbarton

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

Commit Details:

Full Hash: 45dbc38a8b156a6e704575f4935c7f3f9cf96e5d
Parent Commit: 8d67054
Lines Changed: +113, -0

1 Modified Path:

/source/blender/blenkernel/intern/unit.c (+113, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021