Grease Pencil sketches get included when doing OpenGL previews for scene strips in...
authorJoshua Leung <aligorith@gmail.com>
Fri, 5 Dec 2014 02:47:23 +0000 (15:47 +1300)
committerJoshua Leung <aligorith@gmail.com>
Fri, 5 Dec 2014 02:47:23 +0000 (15:47 +1300)
After double checking the sequencer code, there doesn't seem to be any reason to
exclude these from the sequencer previews. This makes it possible to use the
sequencer to non-destructively chain together difference Grease Pencil animated
shots together without having to render each image sequence first, allowing for
a smoother workflow.

Just in case the initial assumption isn't entirely correct, I've put in place
an extra arg to the relevant functions which can be hooked up to a suitable
option on the scene strip later to turn this on/off as needed.

source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/include/ED_view3d.h
source/blender/editors/render/render_opengl.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/windowmanager/intern/wm_files.c

index 97cd5bd1bcb36869d60989b11067cb42d0a60866..5a0c7ac1ce188086002a0cffd9e7f769bb2b67b6 100644 (file)
@@ -393,7 +393,7 @@ struct Sequence *BKE_sequencer_add_sound_strip(struct bContext *C, ListBase *seq
 struct Sequence *BKE_sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
 
 /* view3d draw callback, run when not in background view */
-typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, int, char[256]);
+typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, struct Object *, int, int, unsigned int, int, bool, bool, bool, int, char[256]);
 extern SequencerDrawView sequencer_view3d_cb;
 
 /* copy/paste */
index 86a2b1d8b613960cb47647ae1b9e8acc619a703e..06eecc4b015a950b068c6a8e3557facba235df7b 100644 (file)
@@ -2586,7 +2586,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
                ibuf = sequencer_view3d_cb(scene, camera, width, height, IB_rect,
                                           context->scene->r.seq_prev_type,
                                           (context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0,
-                                          true, scene->r.alphamode, err_out);
+                                          true, true, scene->r.alphamode, err_out);
                if (ibuf == NULL) {
                        fprintf(stderr, "seq_render_scene_strip failed to get opengl buffer: %s\n", err_out);
                }
index bd4f37cfb1e789abbc8a77e4b4a621a811c994e6..76ad4ba7bdb01e963e8652eb5c8f9b1cbbd6b6a8 100644 (file)
@@ -309,7 +309,7 @@ void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct AR
 struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag,
                                              bool draw_background, int alpha_mode, char err_out[256]);
 struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype,
-                                                    bool use_solid_tex, bool draw_background, int alpha_mode, char err_out[256]);
+                                                    bool use_solid_tex, bool use_gpencil, bool draw_background, int alpha_mode, char err_out[256]);
 void ED_view3d_offscreen_sky_color_get(struct Scene *scene, float sky_color[3]);
 
 struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
index 433630f6ed43c7d405c97016aa4de40af983a46f..7df281b70bd56aa38734d40842aa850b9062086d 100644 (file)
@@ -272,7 +272,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
                /* shouldnt suddenly give errors mid-render but possible */
                char err_out[256] = "unknown";
                ImBuf *ibuf_view = ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera, oglrender->sizex, oglrender->sizey,
-                                                                        IB_rect, OB_SOLID, false, true,
+                                                                        IB_rect, OB_SOLID, false, true, true,
                                                                         (draw_sky) ? R_ADDSKY : R_ALPHAPREMUL, err_out);
                camera = scene->camera;
 
index bc5ef14e8bcb897cb07354e46871a6c3d20be5f6..9a81597607307a28d474f37a1bb481c33db7d40f 100644 (file)
@@ -3147,7 +3147,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
 
 /* creates own 3d views, used by the sequencer */
 ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int width, int height, unsigned int flag, int drawtype,
-                                             bool use_solid_tex, bool draw_background, int alpha_mode, char err_out[256])
+                                             bool use_solid_tex, bool use_gpencil, bool draw_background, int alpha_mode, char err_out[256])
 {
        View3D v3d = {NULL};
        ARegion ar = {NULL};
@@ -3162,6 +3162,9 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, Object *camera, int w
        v3d.lay = scene->lay;
        v3d.drawtype = drawtype;
        v3d.flag2 = V3D_RENDER_OVERRIDE;
+       
+       if (use_gpencil)
+               v3d.flag2 |= V3D_SHOW_GPENCIL;
 
        if (use_solid_tex)
                v3d.flag2 |= V3D_SOLID_TEX;
index 412d65dc5ca2eb563ea8f7a213ec470d1787dadf..c1c31f6795d5872f5b25921a3d61ff9ecffb1abe 100644 (file)
@@ -840,7 +840,7 @@ static ImBuf *blend_file_thumb(Scene *scene, bScreen *screen, int **thumb_pt)
        if (scene->camera) {
                ibuf = ED_view3d_draw_offscreen_imbuf_simple(scene, scene->camera,
                                                             BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2,
-                                                            IB_rect, OB_SOLID, false, false, R_ADDSKY, err_out);
+                                                            IB_rect, OB_SOLID, false, false, false, R_ADDSKY, err_out);
        }
        else {
                ibuf = ED_view3d_draw_offscreen_imbuf(scene, v3d, ar, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2,