diff options
author | Richard Antalik <richardantalik@gmail.com> | 2019-06-07 00:44:12 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2019-06-07 02:23:39 +0300 |
commit | 9c0060572928d75faf999f148fc49570bee765e7 (patch) | |
tree | bd06bb375e75069e95c1ed988747f3746e1926b3 /source/blender/makesrna | |
parent | 2175fb02170401355697dec36bed9be6a72c5570 (diff) |
VSE: Cache invalidation
Add invalidation to strip add functions
Add invalidation for scene and movieclip strips
Skip invalidation for sound strips
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4989
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_movieclip.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer_api.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 18 |
6 files changed, 33 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index eda89ebfb50..7cb1610fd31 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -126,8 +126,7 @@ static void rna_Camera_background_images_clear(Camera *cam) static void rna_Camera_dof_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) { - /* TODO(sergey): Can be more selective here. */ - BKE_sequencer_cache_cleanup_all(bmain); + BKE_sequence_invalidate_scene_strips(bmain, scene); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); } diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 5f3fcaa48d7..43df1d8e1aa 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -598,12 +598,14 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, MovieClip *clip = (MovieClip *)id; BKE_movieclip_reload(bmain, clip); + BKE_sequence_invalidate_movieclip_strips(bmain, clip); WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, &clip->id); WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, &clip->id); } else if (GS(id->name) == ID_SCE) { Scene *scene = (Scene *)id; + BKE_sequence_invalidate_scene_strips(bmain, scene); if (scene->ed) { ColorManagedColorspaceSettings *colorspace_settings = (ColorManagedColorspaceSettings *) @@ -641,8 +643,6 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL); } } - - BKE_sequencer_cache_cleanup_all(bmain); } static char *rna_ColorManagedSequencerColorspaceSettings_path(PointerRNA *UNUSED(ptr)) diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index d09b6f6af9b..247c4c69019 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -46,6 +46,8 @@ # include "ED_clip.h" +# include "BKE_sequencer.h" + # include "DNA_screen_types.h" # include "DNA_space_types.h" @@ -71,7 +73,14 @@ static float rna_MovieClip_fps_get(PointerRNA *ptr) return BKE_movieclip_get_fps(clip); } -static void rna_MovieClipUser_proxy_render_settings_update(Main *UNUSED(bmain), +static void rna_MovieClip_use_proxy_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + MovieClip *clip = (MovieClip *)ptr->id.data; + BKE_movieclip_clear_cache(clip); + BKE_sequence_invalidate_movieclip_strips(bmain, clip); +} + +static void rna_MovieClipUser_proxy_render_settings_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { @@ -97,6 +106,7 @@ static void rna_MovieClipUser_proxy_render_settings_update(Main *UNUSED(bmain), if (clip && (clip->flag & MCLIP_USE_PROXY)) { BKE_movieclip_clear_cache(clip); + BKE_sequence_invalidate_movieclip_strips(bmain, clip); } break; @@ -336,7 +346,7 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text( prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip"); - RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_use_proxy_update"); prop = RNA_def_int_vector(srna, "size", diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 702900e222f..54f9a52477a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2052,7 +2052,7 @@ static void rna_SceneCamera_update(Main *bmain, Scene *UNUSED(scene), PointerRNA Scene *scene = (Scene *)ptr->id.data; Object *camera = scene->camera; - BKE_sequencer_cache_cleanup_all(bmain); + BKE_sequence_invalidate_scene_strips(bmain, scene); if (camera && (camera->type == OB_CAMERA)) { DEG_id_tag_update(&camera->id, ID_RECALC_GEOMETRY); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index a50f01afd78..37ebb76daa5 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -133,6 +133,7 @@ static Sequence *rna_Sequences_new_mask( id_us_plus((ID *)mask); BKE_sequence_calc_disp(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); @@ -153,6 +154,7 @@ static Sequence *rna_Sequences_new_scene( id_us_plus((ID *)sce_seq); BKE_sequence_calc_disp(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); @@ -181,6 +183,7 @@ static Sequence *rna_Sequences_new_image(ID *id, } BKE_sequence_calc_disp(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); @@ -216,6 +219,7 @@ static Sequence *rna_Sequences_new_movie(ID *id, seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN); BKE_sequence_calc_disp(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); @@ -340,6 +344,7 @@ static Sequence *rna_Sequences_new_effect(ID *id, BKE_sequence_calc(scene, seq); BKE_sequence_calc_disp(scene, seq); + BKE_sequence_invalidate_cache_composite(scene, seq); WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); @@ -375,7 +380,6 @@ static StripElem *rna_SequenceElements_append(ID *id, Sequence *seq, const char seq->len++; BKE_sequence_calc_disp(scene, seq); - WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); return se; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 12f5535dcc3..4b08f75eb06 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -30,6 +30,7 @@ #include "BKE_movieclip.h" #include "BKE_node.h" #include "BKE_studiolight.h" +#include "BKE_sequencer.h" #include "BLI_math.h" @@ -1974,9 +1975,14 @@ static void rna_SpaceConsole_rect_update(Main *UNUSED(bmain), WM_main_add_notifier(NC_SPACE | ND_SPACE_CONSOLE | NA_EDITED, sc); } -static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), - Scene *UNUSED(scene), - PointerRNA *ptr) +static void rna_SequenceEditor_update_cache(Main *UNUSED(bmain), + Scene *scene, + PointerRNA *UNUSED(ptr)) +{ + BKE_sequencer_cache_cleanup(scene); +} + +static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { ScrArea *sa = rna_area_from_space(ptr); ED_area_tag_refresh(sa); @@ -4498,13 +4504,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined"); RNA_def_property_range(prop, -5, MAXSEQ); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache"); prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, preview_channels_items); RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to draw"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache"); prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); @@ -4524,7 +4530,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proxy Render Size", "Display preview using full resolution or different proxy resolutions"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache"); /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); |