diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 05e5f70af4d..6622ebbc847 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -416,6 +416,13 @@ class USERPREF_PT_system(bpy.types.Panel): col.separator() col.separator() col.separator() + + col.label(text="Screencast:") + col.prop(system, "screencast_fps") + col.prop(system, "screencast_wait_time") + col.separator() + col.separator() + col.separator() #column = split.column() #colsplit = column.split(percentage=0.85) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 67f3870461a..8fa925a9c54 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1373,6 +1373,10 @@ void init_userdef_do_versions(void) if (U.anim_player_preset == 0) { U.anim_player_preset =1 ; } + if (U.scrcastfps == 0) { + U.scrcastfps = 10; + U.scrcastwait = 50; + } /* funny name, but it is GE stuff, moves userdef stuff to engine */ // XXX space_set_commmandline_options(); diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 7fea28304ba..a756eff8c11 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -38,6 +38,7 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "DNA_userdef_types.h" #include "BKE_context.h" #include "BKE_global.h" @@ -226,7 +227,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update) int cfra= 1; /* we need this as local variables for renderdata */ - rd.frs_sec= 10; + rd.frs_sec= U.scrcastfps; rd.frs_sec_base= 1.0f; if(BKE_imtype_is_movie(rd.imtype)) { @@ -279,9 +280,10 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update) *do_update= 1; cfra++; + } else - PIL_sleep_ms(50); + PIL_sleep_ms(U.scrcastwait); } if(mh) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index fc7b41871d4..55eba879865 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -341,7 +341,10 @@ typedef struct UserDef { short ndof_pan, ndof_rotate; short curssize, ipo_new; short color_picker_type; - short pad2[3]; + short pad2; + + short scrcastfps; /* frame rate for screencast to be played back */ + short scrcastwait; /* milliseconds between screencast snapshots */ char versemaster[160]; char verseuser[160]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4e3e6cb336d..22ab36d5b2a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2322,6 +2322,16 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count."); RNA_def_property_update(prop, 0, "rna_UserDef_audio_update"); + prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "scrcastfps"); + RNA_def_property_range(prop, 10, 50); + RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back."); + + prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "scrcastwait"); + RNA_def_property_range(prop, 50, 1000); + RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast."); + #if 0 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "versemaster");