[Bf-blender-cvs] [96d8b1eb7a3] soc-2021-vse-strip-thumbnails: Fix conditions to start Thumbnail Job

Aditya Y Jeppu noreply at git.blender.org
Sun Jul 18 13:33:33 CEST 2021


Commit: 96d8b1eb7a3330922bda835a5defda0609e8acd6
Author: Aditya Y Jeppu
Date:   Sun Jul 18 17:00:54 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rB96d8b1eb7a3330922bda835a5defda0609e8acd6

Fix conditions to start Thumbnail Job

Jobs started when view changes or images not loading. Multiple strips now
work without error but slow. In the order of strips thumbs are loaded.

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

M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/space_sequencer/sequencer_draw.c

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

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 766e0b855e0..61a7a89958c 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -5794,8 +5794,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C)
       break;
     }
     if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE) ||
-        WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE) ||
-        WM_jobs_test(wm, scene, WM_JOB_TYPE_SEQ_DRAW_THUMBNAIL)) {
+        WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE)) {
       /* Skip bake jobs in compositor to avoid compo header displaying
        * progress bar which is not being updated (bake jobs only need
        * to update NC_IMAGE context.
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 294fc52d70d..d445bbaa2f4 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1246,13 +1246,12 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
 
   /* TODO(AYJ) : add ability to add to a list each strip that needs thumbnail job done */
 
-  static rctf view_check = {0, 0, 0, 0};
-  static float strip_change_check = 0.0;
+  static rctf check_view = {0, 0, 0, 0};
+  float cache_start_frame = x1;
 
-  if (x1 != strip_change_check || BLI_rctf_compare(&view_check, &v2d->cur, 0.0)) {
-    sequencer_thumbnail_get_job(C, v2d, x1, thumb_w, context, seq);
-    strip_change_check = x1;
-    view_check = v2d->cur;
+  if (!BLI_rctf_compare(&check_view, &v2d->cur, 0.1)) {
+    sequencer_thumbnail_get_job(C, v2d, cache_start_frame, thumb_w, context, seq);
+    check_view = v2d->cur;
   }
 
   /* Start drawing */
@@ -1291,7 +1290,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
       IMB_freeImBuf(ibuf);
     }
     else {
-      sequencer_thumbnail_get_job(C, v2d, x1, thumb_w, context, seq);
+      sequencer_thumbnail_get_job(C, v2d, cache_start_frame, thumb_w, context, seq);
       break;
     }



More information about the Bf-blender-cvs mailing list