[Bf-blender-cvs] [06356115b71] master: VSE: Don't draw thumbnails while rendering

Richard Antalik noreply at git.blender.org
Mon Oct 18 22:25:56 CEST 2021


Commit: 06356115b71fb0668b0b67735f92ba6660434a96
Author: Richard Antalik
Date:   Mon Oct 18 22:20:25 2021 +0200
Branches: master
https://developer.blender.org/rB06356115b71fb0668b0b67735f92ba6660434a96

VSE: Don't draw thumbnails while rendering

During rendering VSE cache is invalidated, so thumbnails would be
removed and thumbnail job would constantly restart.

Even if thumbnails would be preserved, resources should be dedicated
for rendering job.

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

M	source/blender/editors/space_sequencer/sequencer_thumbnails.c

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

diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c
index 0ea952d0999..557c233744e 100644
--- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c
+++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c
@@ -291,20 +291,26 @@ static void sequencer_thumbnail_start_job_if_necessary(const bContext *C,
     return;
   }
 
-  /* `thumbnail_is_missing` should be set to true if missing image in strip. False when normal call
-   * to all strips done.  */
-  if (v2d->cur.xmax != sseq->runtime.last_thumbnail_area.xmax ||
-      v2d->cur.ymax != sseq->runtime.last_thumbnail_area.ymax || thumbnail_is_missing) {
+  /* During rendering, cache is wiped, it doesn't make sense to render thumbnails. */
+  if (G.is_rendering) {
+    return;
+  }
 
-    /* Stop the job first as view has changed. Pointless to continue old job. */
-    if (v2d->cur.xmax != sseq->runtime.last_thumbnail_area.xmax ||
-        v2d->cur.ymax != sseq->runtime.last_thumbnail_area.ymax) {
-      WM_jobs_stop(CTX_wm_manager(C), NULL, thumbnail_start_job);
-    }
+  /* Job start requested, but over area which has been processed. Unless `thumbnail_is_missing` is
+   * true, ignore this request as all images are in view. */
+  if (v2d->cur.xmax == sseq->runtime.last_thumbnail_area.xmax &&
+      v2d->cur.ymax == sseq->runtime.last_thumbnail_area.ymax && !thumbnail_is_missing) {
+    return;
+  }
 
-    sequencer_thumbnail_init_job(C, v2d, ed);
-    sseq->runtime.last_thumbnail_area = v2d->cur;
+  /* Stop the job first as view has changed. Pointless to continue old job. */
+  if (v2d->cur.xmax != sseq->runtime.last_thumbnail_area.xmax ||
+      v2d->cur.ymax != sseq->runtime.last_thumbnail_area.ymax) {
+    WM_jobs_stop(CTX_wm_manager(C), NULL, thumbnail_start_job);
   }
+
+  sequencer_thumbnail_init_job(C, v2d, ed);
+  sseq->runtime.last_thumbnail_area = v2d->cur;
 }
 
 void last_displayed_thumbnails_list_free(void *val)



More information about the Bf-blender-cvs mailing list