Commit: c27b489ef72d5af39f06b17619cfd583a0f4cc80
Author: Richard Antalik
Date:   Thu Sep 16 00:36:52 2021 +0200
Branches: temp-vse-thumbnail-mod
https://developer.blender.org/rBc27b489ef72d5af39f06b17619cfd583a0f4cc80

Fix alpha on overlap for float images

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

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

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

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c 
b/source/blender/editors/space_sequencer/sequencer_draw.c
index b1560714d62..45e78bf11cd 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1715,9 +1715,17 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
     /* Transparency on overlap. */
     if (seq->flag & SEQ_OVERLAP) {
       GPU_blend(GPU_BLEND_ALPHA);
-      unsigned char *buf = (unsigned char *)ibuf->rect;
-      for (int pixel = ibuf->x * ibuf->y; pixel--; buf += 4) {
-        buf[3] = OVERLAP_ALPHA;
+      if (ibuf->rect) {
+        unsigned char *buf = (unsigned char *)ibuf->rect;
+        for (int pixel = ibuf->x * ibuf->y; pixel--; buf += 4) {
+          buf[3] = OVERLAP_ALPHA;
+        }
+      }
+      else if (ibuf->rect_float) {
+        float *buf = (float *)ibuf->rect_float;
+        for (int pixel = ibuf->x * ibuf->y; pixel--; buf += ibuf->channels) {
+          buf[3] = (OVERLAP_ALPHA / 255.0f);
+        }
       }
     }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to