diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2021-06-08 12:50:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2021-06-10 13:15:59 +0300 |
commit | 5fa6cdb77a9860ce673f685fd29e11b1c3ee8ad8 (patch) | |
tree | 9f5fcc26cf0f1893054183db59bf7e5379450b02 /source/blender/makesrna/RNA_types.h | |
parent | 5304c6ed7d6288ac40bbc79391668c397e30afb8 (diff) |
Add unit for time stored in seconds
Allows to define properties which will have proper units displayed
in the interface. The internal storage is expected to be seconds
(which matches how other times are stored in Blender).
Is not immediately used in Blender, but is required for the upcoming
feature in Cycles X (D11526)
The naming does not sound very exciting, but can't think of anything
better either.
For test it probably easiest to define FloatProperty with subdtype
of TIME_ABSOLUTE.
Differential Revision: https://developer.blender.org/D11532
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 4a6d6dddec7..8e1cfafcc42 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -82,17 +82,18 @@ typedef enum PropertyType { /* also update rna_property_subtype_unit when you change this */ typedef enum PropertyUnit { PROP_UNIT_NONE = (0 << 16), - PROP_UNIT_LENGTH = (1 << 16), /* m */ - PROP_UNIT_AREA = (2 << 16), /* m^2 */ - PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ - PROP_UNIT_MASS = (4 << 16), /* kg */ - PROP_UNIT_ROTATION = (5 << 16), /* radians */ - PROP_UNIT_TIME = (6 << 16), /* frame */ - PROP_UNIT_VELOCITY = (7 << 16), /* m/s */ - PROP_UNIT_ACCELERATION = (8 << 16), /* m/(s^2) */ - PROP_UNIT_CAMERA = (9 << 16), /* mm */ - PROP_UNIT_POWER = (10 << 16), /* W */ - PROP_UNIT_TEMPERATURE = (11 << 16), /* C */ + PROP_UNIT_LENGTH = (1 << 16), /* m */ + PROP_UNIT_AREA = (2 << 16), /* m^2 */ + PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ + PROP_UNIT_MASS = (4 << 16), /* kg */ + PROP_UNIT_ROTATION = (5 << 16), /* radians */ + PROP_UNIT_TIME = (6 << 16), /* frame */ + PROP_UNIT_TIME_ABSOLUTE = (7 << 16), /* time in seconds (independent of scene) */ + PROP_UNIT_VELOCITY = (8 << 16), /* m/s */ + PROP_UNIT_ACCELERATION = (9 << 16), /* m/(s^2) */ + PROP_UNIT_CAMERA = (10 << 16), /* mm */ + PROP_UNIT_POWER = (11 << 16), /* W */ + PROP_UNIT_TEMPERATURE = (12 << 16), /* C */ } PropertyUnit; /** @@ -157,6 +158,7 @@ typedef enum PropertySubType { PROP_FACTOR = 15, PROP_ANGLE = 16 | PROP_UNIT_ROTATION, PROP_TIME = 17 | PROP_UNIT_TIME, + PROP_TIME_ABSOLUTE = 17 | PROP_UNIT_TIME_ABSOLUTE, /** Distance in 3d space, don't use for pixel distance for eg. */ PROP_DISTANCE = 18 | PROP_UNIT_LENGTH, PROP_DISTANCE_CAMERA = 19 | PROP_UNIT_CAMERA, |