diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:41:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:41:09 +0400 |
commit | 2d97a096d7621918d7385a37429153a1512fbf14 (patch) | |
tree | 8eceda32d6f32d50987f17a5048b45802bd443ed /source/blender | |
parent | dc0604104966cf06c72e5fecff0f8714e3fe5394 (diff) |
add rna attribute 'frame_current_final', without this you had to
manually calcualte it with the subframe and time remapping vars.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5ae4400a19c..d6dc2162720 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -525,6 +525,13 @@ static void rna_Scene_frame_current_set(PointerRNA *ptr, int value) data->r.cfra = value; } +static float rna_Scene_frame_current_final_get(PointerRNA *ptr) +{ + Scene *scene = (Scene *)ptr->data; + + return BKE_scene_frame_get_from_ctime(scene, (float)scene->r.cfra); +} + static void rna_Scene_start_frame_set(PointerRNA *ptr, int value) { Scene *data = (Scene *)ptr->data; @@ -5149,6 +5156,13 @@ void RNA_def_scene(BlenderRNA *brna) "Number of frames to skip forward while rendering/playing back each frame"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); + prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); + RNA_def_property_range(prop, MINAFRAME, MAXFRAME); + RNA_def_property_float_funcs(prop, "rna_Scene_frame_current_final_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Current Frame Final", + "Current frame with subframe and time remapping applied"); + /* Preview Range (frame-range for UI playback) */ prop = RNA_def_property(srna, "use_preview_range", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); |