From 5fa6cdb77a9860ce673f685fd29e11b1c3ee8ad8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 8 Jun 2021 11:50:19 +0200 Subject: 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 --- source/blender/python/intern/bpy_props.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/python') 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", ""}, -- cgit v1.2.3