diff options
Diffstat (limited to 'source')
23 files changed, 72 insertions, 54 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 8cd86593873..e3bd57e75e3 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -145,7 +145,7 @@ void BKE_scene_update_tag_audio_volume(struct Depsgraph *, struct Scene *scene); void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain); void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain); -void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph, struct Main *bmain); +void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph); void BKE_scene_view_layer_graph_evaluated_ensure(struct Main *bmain, struct Scene *scene, diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 64e642462af..8c5915d3768 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -4025,7 +4025,6 @@ static void ptcache_dt_to_str(char *str, double dtime) /* if bake is not given run simulations to current frame */ void BKE_ptcache_bake(PTCacheBaker *baker) { - Main *bmain = baker->bmain; Scene *scene = baker->scene; ViewLayer *view_layer = baker->view_layer; struct Depsgraph *depsgraph = baker->depsgraph; @@ -4156,7 +4155,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker) stime = ptime = PIL_check_seconds_timer(); for (int fr = CFRA; fr <= endframe; fr += baker->quick_step, CFRA = fr) { - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); if (baker->update_progress) { float progress = ((float)(CFRA - startframe) / (float)(endframe - startframe)); @@ -4255,7 +4254,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker) CFRA = cfrao; if (bake) { /* already on cfra unless baking */ - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } /* TODO: call redraw all windows somehow */ diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 7e25e8c96ae..f95ee27ed58 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1541,10 +1541,11 @@ void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain) } /* applies changes right away, does all sets too */ -void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain) +void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph) { Scene *scene = DEG_get_input_scene(depsgraph); ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); + Main *bmain = DEG_get_bmain(depsgraph); /* Keep this first. */ BKE_callback_exec_id(bmain, &scene->id, BKE_CB_EVT_FRAME_CHANGE_PRE); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index a2a45ae56b3..b4da0c5bd33 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3593,7 +3593,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, /* opengl offscreen render */ depsgraph = BKE_scene_get_depsgraph(context->bmain, scene, view_layer, true); - BKE_scene_graph_update_for_newframe(depsgraph, context->bmain); + BKE_scene_graph_update_for_newframe(depsgraph); ibuf = sequencer_view3d_fn( /* set for OpenGL render (NULL when scrubbing) */ depsgraph, @@ -3695,7 +3695,7 @@ finally: scene->r.subframe = orig_data.subframe; if (is_frame_update && (depsgraph != NULL)) { - BKE_scene_graph_update_for_newframe(depsgraph, context->bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } #ifdef DURIAN_CAMERA_SWITCH diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h index e0166a13d69..7eb5f1ccec1 100644 --- a/source/blender/depsgraph/DEG_depsgraph_query.h +++ b/source/blender/depsgraph/DEG_depsgraph_query.h @@ -55,6 +55,9 @@ struct Scene *DEG_get_input_scene(const Depsgraph *graph); /* Get view layer that depsgraph was built for. */ struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph); +/* Get bmain that depsgraph was built for. */ +struct Main *DEG_get_bmain(const Depsgraph *graph); + /* Get evaluation mode that depsgraph was built for. */ eEvaluationMode DEG_get_mode(const Depsgraph *graph); diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 0b6014c18f1..fc9ed9a6ab9 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -61,6 +61,12 @@ struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph) return deg_graph->view_layer; } +struct Main *DEG_get_bmain(const Depsgraph *graph) +{ + const deg::Depsgraph *deg_graph = reinterpret_cast<const deg::Depsgraph *>(graph); + return deg_graph->bmain; +} + eEvaluationMode DEG_get_mode(const Depsgraph *graph) { const deg::Depsgraph *deg_graph = reinterpret_cast<const deg::Depsgraph *>(graph); diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c index 4c10c66dfa6..eb3bdf43a3c 100644 --- a/source/blender/editors/animation/anim_motion_paths.c +++ b/source/blender/editors/animation/anim_motion_paths.c @@ -69,9 +69,9 @@ typedef struct MPathTarget { /* ........ */ /* update scene for current frame */ -static void motionpaths_calc_update_scene(Main *bmain, struct Depsgraph *depsgraph) +static void motionpaths_calc_update_scene(struct Depsgraph *depsgraph) { - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } Depsgraph *animviz_depsgraph_build(Main *bmain, @@ -95,7 +95,7 @@ Depsgraph *animviz_depsgraph_build(Main *bmain, MEM_freeN(ids); /* Update once so we can access pointers of evaluated animation data. */ - motionpaths_calc_update_scene(bmain, depsgraph); + motionpaths_calc_update_scene(depsgraph); return depsgraph; } @@ -471,7 +471,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, } else { /* Update relevant data for new frame. */ - motionpaths_calc_update_scene(bmain, depsgraph); + motionpaths_calc_update_scene(depsgraph); } /* perform baking for targets */ @@ -484,7 +484,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, * We always have to restore the current frame though. */ CFRA = cfra; if (range != ANIMVIZ_CALC_RANGE_CURRENT_FRAME && restore) { - motionpaths_calc_update_scene(bmain, depsgraph); + motionpaths_calc_update_scene(depsgraph); } if (is_active_depsgraph) { diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 99e98df3397..1bbba6c4b8a 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -3645,7 +3645,6 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_gpencil_data_get_active(C); Scene *scene = CTX_data_scene(C); - Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ARegion *region = CTX_wm_region(C); int oldframe = (int)DEG_get_ctime(depsgraph); @@ -3669,7 +3668,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op) if ((mode == GP_REPROJECT_SURFACE) && (cfra_prv != gpf_->framenum)) { cfra_prv = gpf_->framenum; CFRA = gpf_->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } ED_gpencil_stroke_reproject(depsgraph, &gsc, sctx, gpl, gpf_, gps, mode, keep_original); @@ -3679,7 +3678,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op) /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); if (sctx != NULL) { ED_transform_snap_object_context_destroy(sctx); diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c index a6088e31ff8..f4e40c2670f 100644 --- a/source/blender/editors/gpencil/gpencil_mesh.c +++ b/source/blender/editors/gpencil/gpencil_mesh.c @@ -246,7 +246,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op) /* Move scene to new frame. */ CFRA = i; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* Loop all objects in the list. */ LISTBASE_FOREACH (GpBakeOb *, elem, &list) { @@ -287,7 +287,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op) /* Return scene frame state and DB to original state. */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* Remove unused materials. */ int actcol = ob_gpencil->actcol; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index f75dd428968..52a7b92217b 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -879,7 +879,6 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) { - Main *bmain = CTX_data_main(C); Scene *scene = oglrender->scene; int i; @@ -929,7 +928,7 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) if (oglrender->timer) { /* exec will not have a timer */ Depsgraph *depsgraph = oglrender->depsgraph; scene->r.cfra = oglrender->cfrao; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); WM_event_remove_timer(oglrender->wm, oglrender->win, oglrender->timer); } @@ -1119,7 +1118,6 @@ static bool schedule_write_result(OGLRender *oglrender, RenderResult *rr) static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) { - Main *bmain = CTX_data_main(C); OGLRender *oglrender = op->customdata; Scene *scene = oglrender->scene; Depsgraph *depsgraph = oglrender->depsgraph; @@ -1134,7 +1132,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) CFRA++; } while (CFRA < oglrender->nfra) { - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); CFRA++; } @@ -1161,7 +1159,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) WM_cursor_time(oglrender->win, scene->r.cfra); - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); if (view_context) { if (oglrender->rv3d->persp == RV3D_CAMOB && oglrender->v3d->camera && diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 06e800433b1..dbf84cad80b 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1594,7 +1594,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) ED_clip_update_frame(bmain, scene->r.cfra); /* this function applies the changes too */ - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } /* diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 050dca07c34..e8eddc014db 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -306,7 +306,6 @@ static void SOUND_OT_update_animation_flags(wmOperatorType *ot) static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op)) { - Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); /* NOTE: We will be forcefully evaluating dependency graph at every frame, so no need to ensure * current scene state is evaluated as it will be lost anyway. */ @@ -318,11 +317,11 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op)) for (cfra = (scene->r.sfra > 0) ? (scene->r.sfra - 1) : 0; cfra <= scene->r.efra + 1; cfra++) { scene->r.cfra = cfra; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } scene->r.cfra = oldfra; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); return OPERATOR_FINISHED; } diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 388c2f35774..2446bfc13dc 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -655,7 +655,7 @@ void FRS_do_stroke_rendering(Render *re, ViewLayer *view_layer) ViewLayer *scene_view_layer = (ViewLayer *)BLI_findstring( &re->scene->view_layers, view_layer->name, offsetof(ViewLayer, name)); Depsgraph *depsgraph = DEG_graph_new(re->main, re->scene, scene_view_layer, DAG_EVAL_RENDER); - BKE_scene_graph_update_for_newframe(depsgraph, re->main); + BKE_scene_graph_update_for_newframe(depsgraph); // prepare Freestyle: // - load mesh diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c index 60c3877b89a..41365da1153 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c @@ -128,7 +128,10 @@ static void deformStroke(GpencilModifierData *md, BKE_gpencil_stroke_geometry_update(gps); } -static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) +static void bakeModifier(Main *UNUSED(bmain), + Depsgraph *depsgraph, + GpencilModifierData *md, + Object *ob) { Scene *scene = DEG_get_evaluated_scene(depsgraph); Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); @@ -147,7 +150,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData * NOTE: this assumes that we don't want armature animation on non-keyframed frames */ CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* compute armature effects on this frame */ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { @@ -158,7 +161,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams)) diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index 30ac18c64ae..1608d7a2d4c 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -280,7 +280,10 @@ static void deformStroke(GpencilModifierData *md, /* FIXME: Ideally we be doing this on a copy of the main depsgraph * (i.e. one where we don't have to worry about restoring state) */ -static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) +static void bakeModifier(Main *UNUSED(bmain), + Depsgraph *depsgraph, + GpencilModifierData *md, + Object *ob) { HookGpencilModifierData *mmd = (HookGpencilModifierData *)md; Scene *scene = DEG_get_evaluated_scene(depsgraph); @@ -297,7 +300,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData * NOTE: this assumes that we don't want hook animation on non-keyframed frames */ CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* compute hook effects on this frame */ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { @@ -308,7 +311,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } static void freeData(GpencilModifierData *md) diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c index 0f5fc4d5cf6..2d2f39f0189 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c @@ -126,7 +126,10 @@ static void deformStroke(GpencilModifierData *md, /* FIXME: Ideally we be doing this on a copy of the main depsgraph * (i.e. one where we don't have to worry about restoring state) */ -static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) +static void bakeModifier(Main *UNUSED(bmain), + Depsgraph *depsgraph, + GpencilModifierData *md, + Object *ob) { LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md; Scene *scene = DEG_get_evaluated_scene(depsgraph); @@ -144,7 +147,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData * NOTE: this assumes that we don't want lattice animation on non-keyframed frames */ CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* recalculate lattice data */ BKE_gpencil_lattice_init(ob); @@ -165,7 +168,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } static void freeData(GpencilModifierData *md) diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c index c99ca64325c..3554cf2e4eb 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c @@ -174,7 +174,10 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec } } -static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) +static void bakeModifier(Main *UNUSED(bmain), + Depsgraph *depsgraph, + GpencilModifierData *md, + Object *ob) { Scene *scene = DEG_get_evaluated_scene(depsgraph); bGPdata *gpd = ob->data; @@ -184,7 +187,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { /* apply mirror effects on this frame */ CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* compute mirror effects on this frame */ generate_geometry(md, ob, gpl, gpf); @@ -193,7 +196,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } static bool isDisabled(GpencilModifierData *UNUSED(md), int UNUSED(userRenderParams)) diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c index 9d10fcbe49b..9e86ea6ecdc 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c @@ -259,7 +259,10 @@ static void deformStroke(GpencilModifierData *md, /* FIXME: Ideally we be doing this on a copy of the main depsgraph * (i.e. one where we don't have to worry about restoring state) */ -static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) +static void bakeModifier(Main *UNUSED(bmain), + Depsgraph *depsgraph, + GpencilModifierData *md, + Object *ob) { TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; Scene *scene = DEG_get_evaluated_scene(depsgraph); @@ -276,7 +279,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData * NOTE: this assumes that we don't want animation on non-keyframed frames */ CFRA = gpf->framenum; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); /* compute effects on this frame */ LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { @@ -287,7 +290,7 @@ static void bakeModifier(Main *bmain, Depsgraph *depsgraph, GpencilModifierData /* return frame state and DB to original state */ CFRA = oldframe; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } static void freeData(GpencilModifierData *md) diff --git a/source/blender/io/alembic/exporter/abc_export_capi.cc b/source/blender/io/alembic/exporter/abc_export_capi.cc index c4966a965eb..eeb13d31bd4 100644 --- a/source/blender/io/alembic/exporter/abc_export_capi.cc +++ b/source/blender/io/alembic/exporter/abc_export_capi.cc @@ -156,7 +156,7 @@ static void export_startjob(void *customdata, // Update the scene for the next frame to render. scene->r.cfra = static_cast<int>(frame); scene->r.subframe = frame - scene->r.cfra; - BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); + BKE_scene_graph_update_for_newframe(data->depsgraph); CLOG_INFO(&LOG, 2, "Exporting frame %.2f", frame); ExportSubset export_subset = abc_archive->export_subset_for_frame(frame); @@ -177,7 +177,7 @@ static void export_startjob(void *customdata, // Finish up by going back to the keyframe that was current before we started. if (CFRA != orig_frame) { CFRA = orig_frame; - BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); + BKE_scene_graph_update_for_newframe(data->depsgraph); } data->export_ok = !data->was_canceled; diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc index a7c5ff1a305..1c23535e248 100644 --- a/source/blender/io/usd/intern/usd_capi.cc +++ b/source/blender/io/usd/intern/usd_capi.cc @@ -127,7 +127,7 @@ static void export_startjob(void *customdata, // Update the scene for the next frame to render. scene->r.cfra = static_cast<int>(frame); scene->r.subframe = frame - scene->r.cfra; - BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); + BKE_scene_graph_update_for_newframe(data->depsgraph); iter.set_export_frame(frame); iter.iterate_and_write(); @@ -147,7 +147,7 @@ static void export_startjob(void *customdata, // Finish up by going back to the keyframe that was current before we started. if (CFRA != orig_frame) { CFRA = orig_frame; - BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); + BKE_scene_graph_update_for_newframe(data->depsgraph); } data->export_ok = true; diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 06c73fbb19c..d258677c606 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -73,7 +73,7 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, int frame, float subf for (ViewLayer *view_layer = scene->view_layers.first; view_layer != NULL; view_layer = view_layer->next) { Depsgraph *depsgraph = BKE_scene_get_depsgraph(bmain, scene, view_layer, true); - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } # ifdef WITH_PYTHON diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 0527766d865..e3bf3bdc743 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -615,7 +615,7 @@ static void engine_depsgraph_init(RenderEngine *engine, ViewLayer *view_layer) DEG_ids_clear_recalc(bmain, depsgraph); } else { - BKE_scene_graph_update_for_newframe(engine->depsgraph, bmain); + BKE_scene_graph_update_for_newframe(engine->depsgraph); } } @@ -637,7 +637,7 @@ void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe) CLAMP(cfra, MINAFRAME, MAXFRAME); BKE_scene_frame_set(re->scene, cfra); - BKE_scene_graph_update_for_newframe(engine->depsgraph, re->main); + BKE_scene_graph_update_for_newframe(engine->depsgraph); BKE_scene_camera_switch_update(re->scene); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1964813fff9..8e6b139ca7d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3151,7 +3151,6 @@ static const EnumPropertyItem redraw_timer_type_items[] = { }; static void redraw_timer_step(bContext *C, - Main *bmain, Scene *scene, struct Depsgraph *depsgraph, wmWindow *win, @@ -3202,7 +3201,7 @@ static void redraw_timer_step(bContext *C, } else if (type == eRTAnimationStep) { scene->r.cfra += (cfra == scene->r.cfra) ? 1 : -1; - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); } else if (type == eRTAnimationPlay) { /* play anim, return on same frame as started with */ @@ -3215,7 +3214,7 @@ static void redraw_timer_step(bContext *C, scene->r.cfra = scene->r.sfra; } - BKE_scene_graph_update_for_newframe(depsgraph, bmain); + BKE_scene_graph_update_for_newframe(depsgraph); redraw_timer_window_swap(C); } } @@ -3231,7 +3230,6 @@ static void redraw_timer_step(bContext *C, static int redraw_timer_exec(bContext *C, wmOperator *op) { - Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); wmWindow *win = CTX_wm_window(C); ScrArea *area = CTX_wm_area(C); @@ -3256,7 +3254,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op) wm_window_make_drawable(wm, win); for (a = 0; a < iter; a++) { - redraw_timer_step(C, bmain, scene, depsgraph, win, area, region, type, cfra); + redraw_timer_step(C, scene, depsgraph, win, area, region, type, cfra); iter_steps += 1; if (time_limit != 0.0) { |