diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-31 13:46:32 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-31 19:07:55 +0300 |
commit | 48ea2131aad736f560d21172a91681dbccd18130 (patch) | |
tree | 0bb545edebc0d664c78dafe998f558c040d7649b /source | |
parent | cb614107d3b41c40ca27df0cd5b72dc9df049827 (diff) |
Sequencer: Make dependency graph part of sequencer context
Currently unused, but will be needed soon to deal with active edit
window context.
Diffstat (limited to 'source')
8 files changed, 34 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index cbe7c0b7743..63c91ef9635 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -94,6 +94,7 @@ void BKE_sequence_iterator_end(SeqIterator *iter); typedef struct SeqRenderData { struct Main *bmain; + struct Depsgraph *depsgraph; struct Scene *scene; int rectx; int recty; @@ -113,7 +114,7 @@ typedef struct SeqRenderData { } SeqRenderData; void BKE_sequencer_new_render_data( - struct Main *bmain, struct Scene *scene, + struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context); @@ -251,7 +252,7 @@ struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra); void BKE_sequencer_update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change); bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, struct Sequence *seq, float cfra); -void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq, struct GSet *file_list, ListBase *queue); +void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Sequence *seq, struct GSet *file_list, ListBase *queue); void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context, short *stop, short *do_update, float *progress); void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index fb619f6c567..1f5a061d1ad 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -593,11 +593,12 @@ void BKE_sequencer_pixel_from_sequencer_space_v4(struct Scene *scene, float pixe /*********************** sequencer pipeline functions *************************/ void BKE_sequencer_new_render_data( - Main *bmain, Scene *scene, int rectx, int recty, + Main *bmain, struct Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context) { r_context->bmain = bmain; + r_context->depsgraph = depsgraph; r_context->scene = scene; r_context->rectx = rectx; r_context->recty = recty; @@ -1462,6 +1463,7 @@ typedef struct SeqIndexBuildContext { int view_id; Main *bmain; + Depsgraph *depsgraph; Scene *scene; Sequence *seq, *orig_seq; } SeqIndexBuildContext; @@ -1950,7 +1952,9 @@ static int seq_proxy_context_count(Sequence *seq, Scene *scene) return num_views; } -void BKE_sequencer_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *seq, struct GSet *file_list, ListBase *queue) +void BKE_sequencer_proxy_rebuild_context( + Main *bmain, Depsgraph *depsgraph, Scene *scene, + Sequence *seq, struct GSet *file_list, ListBase *queue) { SeqIndexBuildContext *context; Sequence *nseq; @@ -1982,6 +1986,7 @@ void BKE_sequencer_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *se context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0; context->bmain = bmain; + context->depsgraph = depsgraph; context->scene = scene; context->orig_seq = seq; context->seq = nseq; @@ -2035,7 +2040,7 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, sho /* fail safe code */ BKE_sequencer_new_render_data( - bmain, context->scene, + bmain, context->depsgraph, context->scene, (scene->r.size * (float) scene->r.xsch) / 100.0f + 0.5f, (scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f, 100, false, diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index bf6aa9c9675..c2bc6170137 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -532,7 +532,7 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender) int chanshown = sseq ? sseq->chanshown : 0; BKE_sequencer_new_render_data( - oglrender->bmain, scene, + oglrender->bmain, oglrender->depsgraph, scene, oglrender->sizex, oglrender->sizey, 100.0f, false, &context); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 06ea3fceb2f..556888c63c2 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -894,7 +894,9 @@ void ED_sequencer_special_preview_clear(void) sequencer_special_update_set(NULL); } -ImBuf *sequencer_ibuf_get(struct Main *bmain, Scene *scene, SpaceSeq *sseq, int cfra, int frame_ofs, const char *viewname) +ImBuf *sequencer_ibuf_get( + struct Main *bmain, struct Depsgraph *depsgraph, Scene *scene, + SpaceSeq *sseq, int cfra, int frame_ofs, const char *viewname) { SeqRenderData context = {0}; ImBuf *ibuf; @@ -919,7 +921,7 @@ ImBuf *sequencer_ibuf_get(struct Main *bmain, Scene *scene, SpaceSeq *sseq, int recty = (render_size * (float)scene->r.ysch) / 100.0f + 0.5f; BKE_sequencer_new_render_data( - bmain, scene, + bmain, depsgraph, scene, rectx, recty, proxy_size, false, &context); context.view_id = BKE_scene_multiview_view_id_get(&scene->r, viewname); @@ -1091,6 +1093,7 @@ static void sequencer_draw_background( void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs, bool draw_overlay, bool draw_backdrop) { struct Main *bmain = CTX_data_main(C); + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); struct ImBuf *ibuf = NULL; struct ImBuf *scope = NULL; struct View2D *v2d = &ar->v2d; @@ -1134,7 +1137,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq } /* for now we only support Left/Right */ - ibuf = sequencer_ibuf_get(bmain, scene, sseq, cfra, frame_ofs, names[sseq->multiview_eye]); + ibuf = sequencer_ibuf_get(bmain, depsgraph, scene, sseq, cfra, frame_ofs, names[sseq->multiview_eye]); if ((ibuf == NULL) || (ibuf->rect == NULL && ibuf->rect_float == NULL)) diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e200dffa308..d82028ef2c9 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -128,8 +128,9 @@ typedef struct TransSeq { /* ***************** proxy job manager ********************** */ typedef struct ProxyBuildJob { - Scene *scene; struct Main *main; + struct Depsgraph *depsgraph; + Scene *scene; ListBase queue; int stop; } ProxyJob; @@ -181,6 +182,7 @@ static void seq_proxy_build_job(const bContext *C) { wmJob *wm_job; ProxyJob *pj; + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); ScrArea *sa = CTX_wm_area(C); @@ -199,6 +201,7 @@ static void seq_proxy_build_job(const bContext *C) if (!pj) { pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job"); + pj->depsgraph = depsgraph; pj->scene = scene; pj->main = CTX_data_main(C); @@ -211,7 +214,7 @@ static void seq_proxy_build_job(const bContext *C) SEQP_BEGIN (ed, seq) { if ((seq->flag & SELECT)) { - BKE_sequencer_proxy_rebuild_context(pj->main, pj->scene, seq, file_list, &pj->queue); + BKE_sequencer_proxy_rebuild_context(pj->main, pj->depsgraph, pj->scene, seq, file_list, &pj->queue); } } SEQ_END @@ -3456,6 +3459,7 @@ static int sequencer_rebuild_proxy_invoke(bContext *C, wmOperator *UNUSED(op), static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq; @@ -3475,7 +3479,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op)) short stop = 0, do_update; float progress; - BKE_sequencer_proxy_rebuild_context(bmain, scene, seq, file_list, &queue); + BKE_sequencer_proxy_rebuild_context(bmain, depsgraph, scene, seq, file_list, &queue); for (link = queue.first; link; link = link->next) { struct SeqIndexBuildContext *context = link->data; diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index de7c46cc02c..86647af0f2e 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -63,7 +63,7 @@ void sequencer_special_update_set(Sequence *seq); /* UNUSED */ // void seq_reset_imageofs(struct SpaceSeq *sseq); -struct ImBuf *sequencer_ibuf_get(struct Main *bmain, struct Scene *scene, struct SpaceSeq *sseq, int cfra, int frame_ofs, const char *viewname); +struct ImBuf *sequencer_ibuf_get(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct SpaceSeq *sseq, int cfra, int frame_ofs, const char *viewname); /* sequencer_edit.c */ struct View2D; diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 4d6ea865b40..d3d847b1aa0 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -91,10 +91,11 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) { Main *bmain = CTX_data_main(C); + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); Scene *scene = CTX_data_scene(C); SpaceSeq *sseq = (SpaceSeq *) CTX_wm_space_data(C); ARegion *ar = CTX_wm_region(C); - ImBuf *ibuf = sequencer_ibuf_get(bmain, scene, sseq, CFRA, 0, NULL); + ImBuf *ibuf = sequencer_ibuf_get(bmain, depsgraph, scene, sseq, CFRA, 0, NULL); ImageSampleInfo *info = op->customdata; float fx, fy; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 4b8415bd8c1..2a80ea59a87 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1697,8 +1697,13 @@ static void do_render_seq(Render *re) tot_views = BKE_scene_multiview_num_views_get(&re->r); ibuf_arr = MEM_mallocN(sizeof(ImBuf *) * tot_views, "Sequencer Views ImBufs"); + /* TODO(sergey): Currently depsgraph is only used to check whether it is an active + * edit window or not to deal with unkeyed changes. We don't have depsgraph here yet, + * but we also dont' deal with unkeyed changes. But still nice to get proper depsgraph + * within tjhe render pipeline, somehow. + */ BKE_sequencer_new_render_data( - re->main, re->scene, + re->main, NULL, re->scene, re_x, re_y, 100, true, &context); |