diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-07 22:59:07 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-07 22:59:07 +0300 |
commit | 36aeb0ec1e2ec8cd6a3690ac11cd3c50f3851802 (patch) | |
tree | 4c9ce5df6ba5cc01eb2e0841c57fd9b0e9690b11 /source/blender/python | |
parent | d4cca7b7b0d858a45c684fd0725344881e0c1c63 (diff) |
UI: Add temperature units
Based on the original patch by Vaishnav S (@padthai), this adds
support for temperature units. Initially supported units are Celsius,
Kelvin, and Fahrenheit.
The units aren't used anywhere with this commit. Those changes should
happen in separate patches by adding PROP_TEMPERATURE to RNA property
definitions. But it should be ensured that the various solvers and
simulations actually properly use real units.
The complexity of some of the changes comes from the fact that these
units have offsets from each other as well as coefficients. This also
makes the implementation in the current unit system troublesome.
For example, entering 0C evaluates correctly to 273K, but 0C + 0C
doubles that result, because each unit value is evaluated separately.
This is quite hard to solve in the general case with Blender's current
unit system, though, so it is not handled in this commit.
Differential Revision: https://developer.blender.org/D4401
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index a78ed601d57..bc708bd4a89 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -172,6 +172,7 @@ static const EnumPropertyItem property_subtype_array_items[] = { {PROP_LAYER, "LAYER", 0, "Layer", ""}, {PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""}, {PROP_POWER, "POWER", 0, "Power", ""}, + {PROP_TEMPERATURE, "TEMPERATURE", 0, "Temperature", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}, |