VSE: Hide cache settings and adjust defaults

Adjust default cache settings for all files to store raw and final
images.

All settings are still available when developer extras option is
enabled in user preferences.

This is part of design task T80278

Differential Revision: https://developer.blender.org/D9745
This commit is contained in:
Richard Antalik 2021-01-08 07:24:55 +01:00
parent 09ea339a6c
commit f448ff2afe
Notes: blender-bot 2023-02-14 04:24:05 +01:00
Referenced by commit 94cd52a162, VSE: Fix duplicate menu entries
Referenced by commit 63cea2b793, Fix versioning code outside of version check
Referenced by issue #80278, VSE 2.0: Performance, Cache System
4 changed files with 56 additions and 22 deletions

View File

@ -412,7 +412,19 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
layout.prop(st, "show_seconds")
layout.prop(st, "show_markers")
layout.menu("SEQUENCER_MT_view_cache", text="Show Cache")
if context.preferences.view.show_developer_ui:
layout.menu("SEQUENCER_MT_view_cache", text="Show Cache")
if is_preview:
layout.separator()
if st.display_mode == 'IMAGE':
layout.prop(st, "use_zoom_to_fit")
layout.prop(ed, "show_overlay", text="Show Frame Overlay")
layout.prop(st, "show_safe_areas", text="Show Safe Areas")
layout.prop(st, "show_metadata", text="Show Metadata")
layout.prop(st, "show_annotation", text="Show Annotations")
elif st.display_mode == 'WAVEFORM':
layout.prop(st, "show_separate_color", text="Show Separate Color Channels")
layout.separator()
@ -1877,11 +1889,12 @@ class SEQUENCER_PT_adjust_color(SequencerButtonsPanel, Panel):
class SEQUENCER_PT_cache_settings(SequencerButtonsPanel, Panel):
bl_label = "Cache Settings"
bl_category = "Proxy & Cache"
bl_category = "Cache"
@classmethod
def poll(cls, context):
return cls.has_sequencer(context) and context.scene.sequence_editor
show_developer_ui = context.preferences.view.show_developer_ui
return cls.has_sequencer(context) and context.scene.sequence_editor and show_developer_ui
def draw(self, context):
layout = self.layout
@ -1900,7 +1913,7 @@ class SEQUENCER_PT_cache_settings(SequencerButtonsPanel, Panel):
class SEQUENCER_PT_proxy_settings(SequencerButtonsPanel, Panel):
bl_label = "Proxy Settings"
bl_category = "Proxy & Cache"
bl_category = "Proxy"
@classmethod
def poll(cls, context):
@ -1925,7 +1938,7 @@ class SEQUENCER_PT_proxy_settings(SequencerButtonsPanel, Panel):
class SEQUENCER_PT_strip_proxy(SequencerButtonsPanel, Panel):
bl_label = "Strip Proxy & Timecode"
bl_category = "Proxy & Cache"
bl_category = "Proxy"
@classmethod
def poll(cls, context):
@ -1987,14 +2000,15 @@ class SEQUENCER_PT_strip_proxy(SequencerButtonsPanel, Panel):
class SEQUENCER_PT_strip_cache(SequencerButtonsPanel, Panel):
bl_label = "Strip Cache"
bl_category = "Proxy & Cache"
bl_category = "Cache"
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
show_developer_ui = context.preferences.view.show_developer_ui
if not cls.has_sequencer(context):
return False
if act_strip(context) is not None:
if act_strip(context) is not None and show_developer_ui:
return True
return False

View File

@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 9
#define BLENDER_FILE_SUBVERSION 10
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file

View File

@ -698,6 +698,16 @@ static void do_versions_291_fcurve_handles_limit(FCurve *fcu)
}
}
static void do_versions_strip_cache_settings_recursive(const ListBase *seqbase)
{
LISTBASE_FOREACH (Sequence *, seq, seqbase) {
seq->cache_flag = 0;
if (seq->type == SEQ_TYPE_META) {
do_versions_strip_cache_settings_recursive(&seq->seqbase);
}
}
}
/* NOLINTNEXTLINE: readability-function-size */
void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
@ -1479,17 +1489,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
/**
* Versioning code until next subversion bump goes here.
*
* \note Be sure to check when bumping the version:
* - "versioning_userdef.c", #blo_do_versions_userdef
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.
*/
{
/* Keep this block, even when empty. */
if (!MAIN_VERSION_ATLEAST(bmain, 292, 10)) {
if (!DNA_struct_find(fd->filesdna, "NodeSetAlpha")) {
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
bNodeTree *nodetree = scene->nodetree;
@ -1508,4 +1508,26 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Editing *ed = SEQ_editing_get(scene, false);
if (ed == NULL) {
continue;
}
ed->cache_flag = (SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_FINAL_OUT);
do_versions_strip_cache_settings_recursive(&ed->seqbase);
}
/**
* Versioning code until next subversion bump goes here.
*
* \note Be sure to check when bumping the version:
* - "versioning_userdef.c", #blo_do_versions_userdef
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.
*/
{
/* Keep this block, even when empty. */
}
}

View File

@ -133,7 +133,6 @@ Sequence *SEQ_sequence_alloc(ListBase *lb, int timeline_frame, int machine, int
seq->strip = seq_strip_alloc(type);
seq->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Sequence Stereo Format");
seq->cache_flag = SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE;
SEQ_relations_session_uuid_generate(seq);
@ -247,8 +246,7 @@ Editing *SEQ_editing_ensure(Scene *scene)
ed->seqbasep = &ed->seqbase;
ed->cache = NULL;
ed->cache_flag = SEQ_CACHE_STORE_FINAL_OUT;
ed->cache_flag |= SEQ_CACHE_VIEW_FINAL_OUT;
ed->cache_flag |= SEQ_CACHE_VIEW_ENABLE;
ed->cache_flag |= SEQ_CACHE_STORE_RAW ;
}
return scene->ed;