[Bf-blender-cvs] [06c4a97320e] temp-vse-h264-proxy: VSE: Simplify proxy settings

Richard Antalik noreply at git.blender.org
Tue Mar 16 13:04:14 CET 2021


Commit: 06c4a97320e92216cf59ca49236e9c49eca4ccf2
Author: Richard Antalik
Date:   Tue Mar 16 12:22:08 2021 +0100
Branches: temp-vse-h264-proxy
https://developer.blender.org/rB06c4a97320e92216cf59ca49236e9c49eca4ccf2

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 (could be separate patch as well)

Design task: T85469

{F9735445}

No change has been done to individual strip setting as users may need to turn proxies on/off individually.
I think it would be best if size selection will be managed when automatic proxy building is enabled. In that case proxy panel can be simplified a lot. This is probalby better to leave for separate patch

Reviewed By: sergey

Maniphest Tasks: T85469

Differential Revision: https://developer.blender.org/D10362

===================================================================

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/blenloader/intern/versioning_290.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/sequencer/SEQ_proxy.h
M	source/blender/sequencer/SEQ_render.h
M	source/blender/sequencer/intern/proxy.c
M	source/blender/sequencer/intern/render.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index fa7082e139a..a4c2ed68a91 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -2000,6 +2000,17 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
         ed = context.scene.sequence_editor
 
         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")
 
         if st.display_mode == 'IMAGE':
@@ -2008,11 +2019,6 @@ class SEQUENCER_PT_view(SequencerButtonsPanel_Output, Panel):
         elif st.display_mode == 'WAVEFORM':
             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):
     bl_label = "Frame Overlay"
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 06bafb20c35..ab0ee271664 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -62,6 +62,7 @@
 #include "BKE_multires.h"
 #include "BKE_node.h"
 
+#include "IMB_imbuf.h"
 #include "MEM_guardedalloc.h"
 
 #include "RNA_access.h"
@@ -101,6 +102,15 @@ static eSpaceSeq_Proxy_RenderSize get_sequencer_render_size(Main *bmain)
   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. */
 static void seq_convert_transform_animation(const Scene *scene,
                                             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_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_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_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_y /= SEQ_rendersize_to_scale_factor(render_size);
   }
@@ -1853,17 +1863,22 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
   {
     /* Keep this block, even when empty. */
 
-    LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
+    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
       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;
+          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;
+              }
             }
           }
         }
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 52efeb1e822..10b24532014 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -184,6 +184,9 @@ static void blo_update_defaults_screen(bScreen *screen,
       SpaceSeq *seq = area->spacedata.first;
       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->render_size = SEQ_RENDER_SIZE_PROXY_100;
+      seq->flag |= SEQ_USE_PROXIES;
     }
     else if (area->spacetype == SPACE_TEXT) {
       /* Show syntax and line numbers in Script workspace text editor. */
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 31d3d0bc1bc..3249eae8c7f 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1312,6 +1312,7 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain,
   SEQ_render_new_render_data(
       bmain, depsgraph, scene, rectx, recty, sseq->render_size, false, &context);
   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
    * by Escape pressed somewhere in the past. */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index dec3097a9ae..de9b842312c 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1,4 +1,4 @@
-/*
+/*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * 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_SOURCE = (1 << 15),
   SEQ_SHOW_STRIP_DURATION = (1 << 16),
+  SEQ_USE_PROXIES = (1 << 17),
 } eSpaceSeq_Flag;
 
 /* SpaceSeq.view */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 63600571c0d..39e6c632b21 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -5170,12 +5170,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
 
   static const EnumPropertyItem proxy_render_size_items[] = {
       {SEQ_RENDER_SIZE_NONE, "NONE", 0, "No display", ""},
-      {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene render size", ""},
-      {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "Proxy size 25%", ""},
-      {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "Proxy size 50%", ""},
-      {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "Proxy size 75%", ""},
-      {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "Proxy size 100%", ""},
-      {SEQ_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""},
+      {SEQ_RENDER_SIZE_SCENE, "SCENE", 0, "Scene size", ""},
+      {SEQ_RENDER_SIZE_PROXY_25, "PROXY_25", 0, "25%", ""},
+      {SEQ_RENDER_SIZE_PROXY_50, "PROXY_50", 0, "50%", ""},
+      {SEQ_RENDER_SIZE_PROXY_75, "PROXY_75", 0, "75%", ""},
+      {SEQ_RENDER_SIZE_PROXY_100, "PROXY_100", 0, "100%", ""},
       {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);
   RNA_def_property_enum_sdna(prop, NULL, "render_size");
   RNA_def_property_enum_items(prop, proxy_render_size_items);
-  RNA_def_property_ui_text(prop,
-                           "Proxy Render Size",
-                           "Display preview using full resolution or different proxy resolutions");
+  RNA_def_property_ui_text(prop, "Preview Size", "");
   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 */
   prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "gpd");
diff --git a/source/blender/sequencer/SEQ_proxy.h b/source/blender/sequencer/SEQ_proxy.h
index 6934215839f..859eac90609 100644
--- a/source/blender/sequencer/SEQ_proxy.h
+++ b/source/blender/sequencer/SEQ_proxy.h
@@ -35,6 +35,7 @@ struct Main;
 struct Scene;
 struct SeqIndexBuildContext;
 struct Sequence;
+struct SeqRenderData;
 
 bool SEQ_proxy_rebuild_context(struct Main *bmain,
                                struct Depsgraph *depsgraph,
@@ -48,7 +49,7 @@ void SEQ_proxy_rebuild(struct SeqIndexBuildContext *context,
                        float *progress);
 void SEQ_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop);
 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 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list