[Bf-blender-cvs] [f9f88f50cb5] master: Fix sequencer preview/strip checks

Campbell Barton noreply at git.blender.org
Fri Oct 8 04:17:08 CEST 2021


Commit: f9f88f50cb5c362dd613f58a5312eceb69269282
Author: Campbell Barton
Date:   Fri Oct 8 12:55:26 2021 +1100
Branches: master
https://developer.blender.org/rBf9f88f50cb5c362dd613f58a5312eceb69269282

Fix sequencer preview/strip checks

- Drawing annotations used a deprecated value to detect
  if drawing was supported.
- ED_space_sequencer_check_show_strip was checking the preview
  image type (which doesn't impact strip display).

Signed-off-by: Campbell Barton <ideasman42 at gmail.com>

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

M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/space_sequencer/sequencer_edit.c

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

diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 59ea105fbbb..8924865f5e1 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1311,7 +1311,7 @@ static bool annotation_session_initdata(bContext *C, tGPsdata *p)
       p->align_flag = &ts->gpencil_v2d_align;
 
       /* check that gpencil data is allowed to be drawn */
-      if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
+      if (!((sseq->mainb == SEQ_DRAW_IMG_IMBUF) && (region->regiontype == RGN_TYPE_PREVIEW))) {
         p->status = GP_STATUS_ERROR;
         return 0;
       }
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 50a74d9e636..2a29125af19 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -130,14 +130,13 @@ bool ED_space_sequencer_maskedit_poll(bContext *C)
 /* Are we displaying the seq output (not channels or histogram). */
 bool ED_space_sequencer_check_show_imbuf(SpaceSeq *sseq)
 {
-  return (ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW) &&
-          ELEM(sseq->mainb, SEQ_DRAW_SEQUENCE, SEQ_DRAW_IMG_IMBUF));
+  return (sseq->mainb == SEQ_DRAW_IMG_IMBUF) &&
+         (ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW));
 }
 
 bool ED_space_sequencer_check_show_strip(SpaceSeq *sseq)
 {
-  return (ELEM(sseq->view, SEQ_VIEW_SEQUENCE, SEQ_VIEW_SEQUENCE_PREVIEW) &&
-          ELEM(sseq->mainb, SEQ_DRAW_SEQUENCE, SEQ_DRAW_IMG_IMBUF));
+  return ELEM(sseq->view, SEQ_VIEW_SEQUENCE, SEQ_VIEW_SEQUENCE_PREVIEW);
 }
 
 static bool sequencer_fcurves_targets_color_strip(const FCurve *fcurve)



More information about the Bf-blender-cvs mailing list