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/python/intern/bpy_props.c | |
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/python/intern/bpy_props.c')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index c21c635913f..6ad80f9160b 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -147,7 +147,17 @@ static const EnumPropertyItem property_subtype_number_items[] = { {PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""}, {PROP_FACTOR, "FACTOR", 0, "Factor", ""}, {PROP_ANGLE, "ANGLE", 0, "Angle", ""}, - {PROP_TIME, "TIME", 0, "Time", ""}, + {PROP_TIME, + "TIME", + 0, + "Time (Scene Relative)", + "Time specified in frames, converted to seconds based on scene frame rate"}, + {PROP_TIME_ABSOLUTE, + "TIME_ABSOLUTE", + 0, + "Time (Absolute)", + "Time specified in seconds, independent of the scene"}, + {PROP_TIME_ABSOLUTE, "TIME_ABSOLUTE", 0, "Time Absolute", ""}, {PROP_DISTANCE, "DISTANCE", 0, "Distance", ""}, {PROP_DISTANCE_CAMERA, "DISTANCE_CAMERA", 0, "Camera Distance", ""}, {PROP_POWER, "POWER", 0, "Power", ""}, |