[Bf-blender-cvs] [e66dc4becaa] soc-2021-vse-strip-thumbnails: Remove progress bar. Make transparent images on overlap during Transform

Aditya Y Jeppu noreply at git.blender.org
Fri Aug 13 20:52:15 CEST 2021


Commit: e66dc4becaa5b057f1eb1eb128ecc212f3bb7b7b
Author: Aditya Y Jeppu
Date:   Sat Aug 14 00:21:23 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rBe66dc4becaa5b057f1eb1eb128ecc212f3bb7b7b

Remove progress bar. Make transparent images on overlap during Transform

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

M	source/blender/blenloader/intern/versioning_300.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/windowmanager/intern/wm_jobs.c

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

diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 862ef99fca5..854c3f9984e 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -698,7 +698,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
         LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
           if (sl->spacetype == SPACE_SEQ) {
             SpaceSeq *sseq = (SpaceSeq *)sl;
-            sseq->flag |= SEQ_SHOW_GRID;
+            sseq->flag |= SEQ_SHOW_GRID | SEQ_SHOW_THUMBNAILS;
           }
         }
       }
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index a1818a44de6..05134910830 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1233,7 +1233,7 @@ static void sequencer_thumbnail_get_job(const bContext *C,
                        CTX_wm_window(C),
                        CTX_data_scene(C),
                        "Draw Thumbnails",
-                       WM_JOB_PROGRESS,
+                       1 << 3,
                        WM_JOB_TYPE_SEQ_DRAW_THUMBNAIL);
 
   /* Get the thumbnail job if it exists. */
@@ -1321,8 +1321,7 @@ static void thumbnail_call_for_job(const bContext *C, Editing *ed, View2D *v2d,
   }
 }
 
-/* TODO(AYJ) : 1) Add operator to choose whether thumbnails required by user or not in overlay menu
- *             2) Decrease Opacity of images when overlay over another strip
+/* TODO(AYJ) : Decrease Opacity of images when overlay over another strip
  */
 
 static void draw_seq_strip_thumbnail(View2D *v2d,
@@ -1411,8 +1410,17 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
 
     /* Get the image */
     ibuf = SEQ_get_thumbnail(&context, seq, roundf(x1), &crop, clipped, false);
+    int tot;
 
     if (ibuf) {
+      if (seq->flag & SEQ_OVERLAP) {
+        GPU_blend(GPU_BLEND_ALPHA);
+        unsigned char *buf = (unsigned char *)ibuf->rect;
+        for (tot = ibuf->x * ibuf->y; tot--; buf += 4) {
+          buf[3] = OVERLAP_ALPHA;
+        }
+      }
+
       ED_draw_imbuf_ctx_clipping(
           C, ibuf, x1 + cut_off, y1, true, x1 + cut_off, y1, x2, y2, zoom_x, zoom_y);
       IMB_freeImBuf(ibuf);
@@ -1420,7 +1428,7 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
     else {
       thumbnail_call_for_job(C, scene->ed, v2d, true);
     }
-
+    GPU_blend(GPU_BLEND_NONE);
     cut_off = 0;
     x1 = x2;
   }
diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c
index 6494c337c10..2604105896d 100644
--- a/source/blender/windowmanager/intern/wm_jobs.c
+++ b/source/blender/windowmanager/intern/wm_jobs.c
@@ -230,7 +230,7 @@ bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
   LISTBASE_FOREACH (wmJob *, wm_job, &wm->jobs) {
     if (wm_job->owner == owner) {
       if (ELEM(job_type, WM_JOB_TYPE_ANY, wm_job->job_type)) {
-        if (wm_job->running || wm_job->suspended) {
+        if ((wm_job->flag & WM_JOB_PROGRESS) && (wm_job->running || wm_job->suspended)) {
           return true;
         }
       }



More information about the Bf-blender-cvs mailing list