VSE: Simplify proxy settings

- Remove Full Render size from VSE preview size. Use just 100% instead.
- Add Use Proxies checkbox to control whether proxies are used globally
- Move preview size to top so it is most prominent
- Set default to 100% preview size and use proxies

Reviewed By: sergey, fsiddi

Differential Revision: https://developer.blender.org/D10362
This commit is contained in:
2021-03-16 17:59:30 +01:00
parent 0449da5460
commit 91561629cd
11 changed files with 76 additions and 41 deletions

View File

@@ -2000,6 +2000,17 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
ed = context.scene.sequence_editor ed = context.scene.sequence_editor
col = layout.column() col = layout.column()
col.prop(st, "proxy_render_size")
col = layout.column()
prop = col.prop(st, "use_proxies")
if st.proxy_render_size in ('NONE', 'SCENE'):
col.enabled = False
col = layout.column()
if ed:
col.prop(ed, "use_prefetch")
col.prop(st, "display_channel", text="Channel") col.prop(st, "display_channel", text="Channel")
if st.display_mode == 'IMAGE': if st.display_mode == 'IMAGE':
@@ -2008,11 +2019,6 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
elif st.display_mode == 'WAVEFORM': elif st.display_mode == 'WAVEFORM':
col.prop(st, "show_separate_color") col.prop(st, "show_separate_color")
col.prop(st, "proxy_render_size")
if ed:
col.prop(ed, "use_prefetch")
class SEQUENCER_PT_frame_overlay(SequencerButtonsPanel_Output, Panel): class SEQUENCER_PT_frame_overlay(SequencerButtonsPanel_Output, Panel):
bl_label = "Frame Overlay" bl_label = "Frame Overlay"

View File

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

View File

@@ -62,6 +62,7 @@
#include "BKE_multires.h" #include "BKE_multires.h"
#include "BKE_node.h" #include "BKE_node.h"
#include "IMB_imbuf.h"
#include "MEM_guardedalloc.h" #include "MEM_guardedalloc.h"
#include "RNA_access.h" #include "RNA_access.h"
@@ -101,6 +102,15 @@ static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
return render_size; return render_size;
} }
static bool can_use_proxy(Sequence *seq, int psize)
{
if (seq->strip->proxy == NULL) {
return false;
}
short size_flags = seq->strip->proxy->build_size_flags;
return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
}
/* image_size is width or height depending what RNA property is converted - X or Y. */ /* image_size is width or height depending what RNA property is converted - X or Y. */
static void seq_convert_transform_animation(const Scene *scene, static void seq_convert_transform_animation(const Scene *scene,
const char *path, const char *path,
@@ -149,7 +159,7 @@ static void seq_convert_transform_crop(const Scene *scene,
image_size_x = s_elem->orig_width; image_size_x = s_elem->orig_width;
image_size_y = s_elem->orig_height; image_size_y = s_elem->orig_height;
if (SEQ_can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) { if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
image_size_x /= SEQ_rendersize_to_scale_factor(render_size); image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
image_size_y /= SEQ_rendersize_to_scale_factor(render_size); image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
} }
@@ -282,7 +292,7 @@ static void seq_convert_transform_crop_2(const Scene *scene,
int image_size_x = s_elem->orig_width; int image_size_x = s_elem->orig_width;
int image_size_y = s_elem->orig_height; int image_size_y = s_elem->orig_height;
if (SEQ_can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) { if (can_use_proxy(seq, SEQ_rendersize_to_proxysize(render_size))) {
image_size_x /= SEQ_rendersize_to_scale_factor(render_size); image_size_x /= SEQ_rendersize_to_scale_factor(render_size);
image_size_y /= SEQ_rendersize_to_scale_factor(render_size); image_size_y /= SEQ_rendersize_to_scale_factor(render_size);
} }
@@ -1841,6 +1851,30 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
} }
} }
if (!MAIN_VERSION_ATLEAST(bmain, 293, 12)) {
for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
switch (sl->spacetype) {
case SPACE_SEQ: {
SpaceSeq *sseq = (SpaceSeq *)sl;
if (ELEM(sseq->render_size,
SEQ_RENDER_SIZE_PROXY_100,
SEQ_RENDER_SIZE_PROXY_75,
SEQ_RENDER_SIZE_PROXY_50,
SEQ_RENDER_SIZE_PROXY_25)) {
sseq->flag |= SEQ_USE_PROXIES;
}
if (sseq->render_size == SEQ_RENDER_SIZE_FULL) {
sseq->render_size = SEQ_RENDER_SIZE_PROXY_100;
}
}
}
}
}
}
}
/** /**
* Versioning code until next subversion bump goes here. * Versioning code until next subversion bump goes here.
* *
@@ -1852,22 +1886,5 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/ */
{ {
/* Keep this block, even when empty. */ /* Keep this block, even when empty. */
LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
if (sl->spacetype == SPACE_SPREADSHEET) {
ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
&sl->regionbase;
ARegion *new_footer = do_versions_add_region_if_not_found(
regionbase, RGN_TYPE_FOOTER, "footer for spreadsheet", RGN_TYPE_HEADER);
if (new_footer != NULL) {
new_footer->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP :
RGN_ALIGN_BOTTOM;
}
}
}
}
}
} }
} }

View File

@@ -184,6 +184,9 @@ static void blo_update_defaults_screen(bScreen *screen,
SpaceSeq *seq = area->spacedata.first; SpaceSeq *seq = area->spacedata.first;
seq->flag |= SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES | SEQ_ZOOM_TO_FIT | SEQ_SHOW_STRIP_OVERLAY | seq->flag |= SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES | SEQ_ZOOM_TO_FIT | SEQ_SHOW_STRIP_OVERLAY |
SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_DURATION; SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_NAME | SEQ_SHOW_STRIP_DURATION;
seq->render_size = SEQ_RENDER_SIZE_PROXY_100;
seq->flag |= SEQ_USE_PROXIES;
} }
else if (area->spacetype == SPACE_TEXT) { else if (area->spacetype == SPACE_TEXT) {
/* Show syntax and line numbers in Script workspace text editor. */ /* Show syntax and line numbers in Script workspace text editor. */

View File

@@ -1312,6 +1312,7 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain,
SEQ_render_new_render_data( SEQ_render_new_render_data(
bmain, depsgraph, scene, rectx, recty, sseq->render_size, false, &context); bmain, depsgraph, scene, rectx, recty, sseq->render_size, false, &context);
context.view_id = BKE_scene_multiview_view_id_get(&scene->r, viewname); context.view_id = BKE_scene_multiview_view_id_get(&scene->r, viewname);
context.use_proxies = (sseq->flag & SEQ_USE_PROXIES) != 0;
/* Sequencer could start rendering, in this case we need to be sure it wouldn't be canceled /* Sequencer could start rendering, in this case we need to be sure it wouldn't be canceled
* by Escape pressed somewhere in the past. */ * by Escape pressed somewhere in the past. */

View File

@@ -1,4 +1,4 @@
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
@@ -646,6 +646,7 @@ typedef enum eSpaceSeq_Flag {
SEQ_SHOW_STRIP_NAME = (1 << 14), SEQ_SHOW_STRIP_NAME = (1 << 14),
SEQ_SHOW_STRIP_SOURCE = (1 << 15), SEQ_SHOW_STRIP_SOURCE = (1 << 15),
SEQ_SHOW_STRIP_DURATION = (1 << 16), SEQ_SHOW_STRIP_DURATION = (1 << 16),
SEQ_USE_PROXIES = (1 << 17),
} eSpaceSeq_Flag; } eSpaceSeq_Flag;
/* SpaceSeq.view */ /* SpaceSeq.view */

View File

@@ -5170,12 +5170,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
static const EnumPropertyItem proxy_render_size_items[] = { static const EnumPropertyItem proxy_render_size_items[] = {
{SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""}, {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
{SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""}, {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
{SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "Proxy size 25%", ""}, {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
{SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "Proxy size 50%", ""}, {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
{SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "Proxy size 75%", ""}, {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
{SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "Proxy size 100%", ""}, {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
{SEQ_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
{0, NULL, 0, NULL, NULL}, {0, NULL, 0, NULL, NULL},
}; };
@@ -5326,11 +5325,15 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE); prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "render_size"); RNA_def_property_enum_sdna(prop, NULL, "render_size");
RNA_def_property_enum_items(prop, proxy_render_size_items); RNA_def_property_enum_items(prop, proxy_render_size_items);
RNA_def_property_ui_text(prop, RNA_def_property_ui_text(prop, "Preview Size", "");
"Proxy Render Size",
"Display preview using full resolution or different proxy resolutions");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache");
prop = RNA_def_property(srna, "use_proxies", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_PROXIES);
RNA_def_property_ui_text(
prop, "Use Proxies", "Use optimized files for faster scrubbing when available");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
/* grease pencil */ /* grease pencil */
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd"); RNA_def_property_pointer_sdna(prop, NULL, "gpd");

View File

@@ -35,6 +35,7 @@ struct Main;
struct Scene; struct Scene;
struct SeqIndexBuildContext; struct SeqIndexBuildContext;
struct Sequence; struct Sequence;
struct SeqRenderData;
bool SEQ_proxy_rebuild_context(struct Main *bmain, bool SEQ_proxy_rebuild_context(struct Main *bmain,
struct Depsgraph *depsgraph, struct Depsgraph *depsgraph,
@@ -48,7 +49,7 @@ void SEQ_proxy_rebuild(struct SeqIndexBuildContext *context,
float *progress); float *progress);
void SEQ_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); void SEQ_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop);
void SEQ_proxy_set(struct Sequence *seq, bool value); void SEQ_proxy_set(struct Sequence *seq, bool value);
bool SEQ_can_use_proxy(struct Sequence *seq, int psize); bool SEQ_can_use_proxy(const struct SeqRenderData *context, struct Sequence *seq, int psize);
int SEQ_rendersize_to_proxysize(int render_size); int SEQ_rendersize_to_proxysize(int render_size);
double SEQ_rendersize_to_scale_factor(int size); double SEQ_rendersize_to_scale_factor(int size);

View File

@@ -44,6 +44,7 @@ typedef struct SeqRenderData {
int rectx; int rectx;
int recty; int recty;
int preview_render_size; int preview_render_size;
bool use_proxies;
int for_render; int for_render;
int motion_blur_samples; int motion_blur_samples;
float motion_blur_shutter; float motion_blur_shutter;

View File

@@ -199,11 +199,12 @@ static bool seq_proxy_get_fname(Editing *ed,
return true; return true;
} }
bool SEQ_can_use_proxy(Sequence *seq, int psize) bool SEQ_can_use_proxy(const struct SeqRenderData *context, Sequence *seq, int psize)
{ {
if (seq->strip->proxy == NULL) { if (seq->strip->proxy == NULL || !context->use_proxies) {
return false; return false;
} }
short size_flags = seq->strip->proxy->build_size_flags; short size_flags = seq->strip->proxy->build_size_flags;
return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0; return (seq->flag & SEQ_USE_PROXY) != 0 && psize != IMB_PROXY_NONE && (size_flags & psize) != 0;
} }
@@ -217,7 +218,7 @@ ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline
StripAnim *sanim; StripAnim *sanim;
/* only use proxies, if they are enabled (even if present!) */ /* only use proxies, if they are enabled (even if present!) */
if (!SEQ_can_use_proxy(seq, SEQ_rendersize_to_proxysize(psize))) { if (!SEQ_can_use_proxy(context, seq, SEQ_rendersize_to_proxysize(psize))) {
return NULL; return NULL;
} }

View File

@@ -1121,7 +1121,7 @@ static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context,
IMB_anim_set_preseek(sanim->anim, seq->anim_preseek); IMB_anim_set_preseek(sanim->anim, seq->anim_preseek);
if (SEQ_can_use_proxy(seq, psize)) { if (SEQ_can_use_proxy(context, seq, psize)) {
/* Try to get a proxy image. /* Try to get a proxy image.
* Movie proxies are handled by ImBuf module with exception of `custom file` setting. */ * Movie proxies are handled by ImBuf module with exception of `custom file` setting. */
if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE && if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE &&
@@ -1793,7 +1793,8 @@ ImBuf *seq_render_strip(const SeqRenderData *context,
} }
/* Proxies are not stored in cache. */ /* Proxies are not stored in cache. */
if (!SEQ_can_use_proxy(seq, SEQ_rendersize_to_proxysize(context->preview_render_size))) { if (!SEQ_can_use_proxy(
context, seq, SEQ_rendersize_to_proxysize(context->preview_render_size))) {
ibuf = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW); ibuf = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW);
} }