diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-11-20 12:32:24 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-11-20 12:32:24 +0300 |
commit | 0540d2b65c282e958dc7621676b1d829544009cf (patch) | |
tree | 921bc7a7c3b653f72e37cd162553a9bead07b56b /source/blender/makesrna/intern/rna_movieclip.c | |
parent | f74fa98e537d820302c3f787ec68a91a3dd254b9 (diff) |
Added MovieClip.fps read-only property to RNA
This makes it possible for a Python script that loads a MovieClip into the
clip editor to also change the scene frame rate to match.
Diffstat (limited to 'source/blender/makesrna/intern/rna_movieclip.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_movieclip.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 3639c8547ba..5318ea172ef 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -72,6 +72,16 @@ static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) values[1] = clip->lastsize[1]; } +static float rna_MovieClip_fps_get(PointerRNA *ptr) +{ + MovieClip *clip = (MovieClip *)ptr->id.data; + if (clip == NULL) { + return 0.0f; + } + + return BKE_movieclip_get_fps(clip); +} + static void rna_MovieClipUser_proxy_render_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = (ID *) ptr->id.data; @@ -362,6 +372,12 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "len"); RNA_def_property_ui_text(prop, "Duration", "Detected duration of movie clip in frames"); + /* FPS */ + prop = RNA_def_property(srna, "fps", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, "rna_MovieClip_fps_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Frame Rate", "Detected frame rate of the movie clip in frames per second"); + /* color management */ prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings"); |