diff options
Diffstat (limited to 'source/blender/editors')
4 files changed, 29 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index 84fd5332316..23d173aebdc 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -38,6 +38,8 @@ int ED_space_sequencer_maskedit_mask_poll(struct bContext *C); int ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene); int ED_space_sequencer_maskedit_poll(struct bContext *C); +int ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq); + void ED_operatormacros_sequencer(void); #endif /* __ED_SEQUENCER_H__ */ diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index bd4bb0896ed..21128408a97 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -41,6 +41,7 @@ #include "ED_screen.h" #include "ED_gpencil.h" +#include "ED_sequencer.h" #include "WM_api.h" #include "WM_types.h" @@ -51,6 +52,14 @@ /* **************************** buttons ********************************* */ +static int sequencer_grease_pencil_panel_poll(const bContext *C, PanelType *UNUSED(pt)) +{ + SpaceSeq *sseq = CTX_wm_space_seq(C); + + /* don't show the gpencil if we are not showing the image */ + return ED_space_sequencer_check_show_imbuf(sseq); +} + void sequencer_buttons_register(ARegionType *art) { PanelType *pt; @@ -60,6 +69,7 @@ void sequencer_buttons_register(ARegionType *art) strcpy(pt->label, N_("Grease Pencil")); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; + pt->poll = sequencer_grease_pencil_panel_poll; BLI_addtail(&art->paneltypes, pt); } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 9cc6b3d07a2..e3db9c23c41 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -62,6 +62,7 @@ #include "ED_gpencil.h" #include "ED_markers.h" #include "ED_mask.h" +#include "ED_sequencer.h" #include "ED_types.h" #include "ED_space_api.h" @@ -921,6 +922,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq GLuint last_texid; unsigned char *display_buffer; void *cache_handle = NULL; + const int is_imbuf = ED_space_sequencer_check_show_imbuf(sseq); if (G.is_rendering == FALSE) { /* stop all running jobs, except screen one. currently previews frustrate Render @@ -1126,8 +1128,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq } if (sseq->flag & SEQ_SHOW_GPENCIL) { - /* draw grease-pencil (image aligned) */ - draw_gpencil_2dimage(C); + if (is_imbuf) { + /* draw grease-pencil (image aligned) */ + draw_gpencil_2dimage(C); + } } if (!scope) @@ -1137,8 +1141,10 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq UI_view2d_view_restore(C); if (sseq->flag & SEQ_SHOW_GPENCIL) { - /* draw grease-pencil (screen aligned) */ - draw_gpencil_view2d(C, 0); + if (is_imbuf) { + /* draw grease-pencil (screen aligned) */ + draw_gpencil_view2d(C, 0); + } } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e7f77db3b9e..409f655bb79 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -496,6 +496,13 @@ int ED_space_sequencer_maskedit_poll(bContext *C) return FALSE; } +/* are we displaying the seq output (not channels or histogram)*/ +int 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)); +} + int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str) { Editing *ed = BKE_sequencer_editing_get(scene, FALSE); |