diff options
Diffstat (limited to 'source/blender')
19 files changed, 78 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 758bf588a9c..23fbcf583ad 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -276,7 +276,7 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets) /* ........ */ /* update scene for current frame */ -static void motionpaths_calc_update_scene(Scene *scene) +static void motionpaths_calc_update_scene(Main *bmain, Scene *scene, struct Depsgraph *depsgraph) { /* Do all updates * - if this is too slow, resort to using a more efficient way @@ -285,8 +285,10 @@ static void motionpaths_calc_update_scene(Scene *scene) * * TODO(segey): Bring back partial updates, which became impossible * with the new depsgraph due to unsorted nature of bases. + * + * TODO(sergey): Use evaluation context dedicated to motion paths. */ - BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene); } /* ........ */ @@ -336,11 +338,13 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) * - recalc: whether we need to */ /* TODO: include reports pointer? */ -void animviz_calc_motionpaths(bContext *UNUSED(C), Scene *scene, ListBase *targets) +void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets) { MPathTarget *mpt; int sfra, efra; int cfra; + Main *bmain = CTX_data_main(C); + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); /* sanity check */ if (ELEM(NULL, targets, targets->first)) @@ -363,7 +367,7 @@ void animviz_calc_motionpaths(bContext *UNUSED(C), Scene *scene, ListBase *targe /* calculate path over requested range */ for (CFRA = sfra; CFRA <= efra; CFRA++) { /* update relevant data for new frame */ - motionpaths_calc_update_scene(scene); + motionpaths_calc_update_scene(bmain, scene, depsgraph); /* perform baking for targets */ motionpaths_calc_bake_targets(scene, targets); @@ -371,7 +375,7 @@ void animviz_calc_motionpaths(bContext *UNUSED(C), Scene *scene, ListBase *targe /* reset original environment */ CFRA = cfra; - motionpaths_calc_update_scene(scene); + motionpaths_calc_update_scene(bmain, scene, depsgraph); /* clear recalc flags from targets */ for (mpt = targets->first; mpt; mpt = mpt->next) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1e034a27e64..6ae826a20b1 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2464,5 +2464,8 @@ void BKE_scene_free_depsgraph_hash(Scene *scene) Depsgraph *BKE_scene_get_depsgraph(Scene *scene, SceneLayer *scene_layer) { (void) scene_layer; + if (scene->depsgraph_legacy == NULL) { + scene->depsgraph_legacy = DEG_graph_new(); + } return scene->depsgraph_legacy; } diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 299c94a6a81..6e59a404e47 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -939,7 +939,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj float ctime = BKE_scene_frame_get_from_ctime(scene, *it); CFRA = BKE_scene_frame_get_from_ctime(scene, *it); - //BKE_scene_update_for_newframe(G.main->eval_ctx, G.main,scene); + //BKE_scene_graph_update_for_newframe(G.main->eval_ctx, depsgraph, G.main,scene); BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, ctime, ADT_RECALC_ALL); if (bone) { diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 93786a484f2..8a1c7239955 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -39,6 +39,7 @@ #include "BLI_compiler_attrs.h" +struct Depsgraph; struct wmWindowManager; struct wmWindow; struct wmNotifier; @@ -163,7 +164,7 @@ bool ED_workspace_layout_cycle( struct bContext *C) ATTR_NONNULL(); /* anim */ -void ED_update_for_newframe(struct Main *bmain, struct Scene *scene); +void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct Depsgraph *depsgraph); void ED_refresh_viewport_fps(struct bContext *C); int ED_screen_animation_play(struct bContext *C, int sync, int mode); diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index 7de94be0c7a..210d8351945 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -289,6 +289,7 @@ typedef struct DynamicPaintBakeJob { struct Main *bmain; Scene *scene; SceneLayer *scene_layer; + Depsgraph *depsgraph; Object *ob; DynamicPaintSurface *surface; @@ -364,7 +365,7 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) frame = surface->start_frame; orig_frame = scene->r.cfra; scene->r.cfra = (int)frame; - ED_update_for_newframe(job->bmain, scene); + ED_update_for_newframe(job->bmain, scene, job->depsgraph); /* Init surface */ if (!dynamicPaint_createUVSurface(scene, surface, job->progress, job->do_update)) { @@ -390,7 +391,7 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) /* calculate a frame */ scene->r.cfra = (int)frame; - ED_update_for_newframe(job->bmain, scene); + ED_update_for_newframe(job->bmain, scene, job->depsgraph); if (!dynamicPaint_calculateFrame(surface, job->eval_ctx, scene, cObject, frame)) { job->success = 0; return; @@ -491,6 +492,7 @@ static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op) job->bmain = CTX_data_main(C); job->scene = scene; job->scene_layer = sl; + job->depsgraph = CTX_data_depsgraph(C); job->ob = ob; job->canvas = canvas; job->surface = surface; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 060ac046ba1..a5e92802c6f 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -332,6 +332,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid { Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); EvaluationContext eval_ctx; Base *base; int i; @@ -408,7 +409,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid /* Modifying the global scene isn't nice, but we can do it in * this part of the process before a threaded job is created */ scene->r.cfra = (int)eval_time; - ED_update_for_newframe(CTX_data_main(C), scene); + ED_update_for_newframe(CTX_data_main(C), scene, depsgraph); /* now scene data should be current according to animation system, so we fill the channels */ @@ -846,6 +847,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor { Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); int i; FluidsimSettings *domainSettings; @@ -957,7 +959,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* reset to original current frame */ scene->r.cfra = origFrame; - ED_update_for_newframe(CTX_data_main(C), scene); + ED_update_for_newframe(CTX_data_main(C), scene, depsgraph); /* ******** init domain object's matrix ******** */ copy_m4_m4(domainMat, fsDomain->obmat); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 77381b43b22..61ff9264e95 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -102,6 +102,10 @@ typedef struct RenderJob { Main *main; Scene *scene; Scene *current_scene; + /* TODO(sergey): Should not be needed once engine will have own + * depsgraph and copy-on-write will be implemented. + */ + Depsgraph *depsgraph; Render *re; SceneRenderLayer *srl; struct Object *camera_override; @@ -338,7 +342,7 @@ static int screen_render_exec(bContext *C, wmOperator *op) RE_SetReports(re, NULL); // no redraw needed, we leave state as we entered it - ED_update_for_newframe(mainp, scene); + ED_update_for_newframe(mainp, scene, CTX_data_depsgraph(C)); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene); @@ -652,7 +656,7 @@ static void render_endjob(void *rjv) if (rj->anim && !(rj->scene->r.scemode & R_NO_FRAME_UPDATE)) { /* possible this fails of loading new file while rendering */ if (G.main->wm.first) { - ED_update_for_newframe(G.main, rj->scene); + ED_update_for_newframe(G.main, rj->scene, rj->depsgraph); } } @@ -915,6 +919,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even rj->main = mainp; rj->scene = scene; rj->current_scene = rj->scene; + /* TODO(sergey): Render engine should be using own depsgraph. */ + rj->depsgraph = CTX_data_depsgraph(C); rj->srl = srl; rj->camera_override = camera_override; rj->lay_override = 0; diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 061a783930d..1bbc6b3e91a 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -124,15 +124,17 @@ void ED_scene_changed_update(Main *bmain, bContext *C, Scene *scene_new, const b * but workspace should remember the last one set. Could store render-layer * per window-workspace combination (using WorkSpaceDataRelation) */ SceneLayer *layer_new = BLI_findlink(&scene_new->render_layers, scene_new->active_layer); + Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene_new, layer_new); CTX_data_scene_set(C, scene_new); BKE_workspace_render_layer_set(CTX_wm_workspace(C), layer_new); BKE_scene_set_background(bmain, scene_new); + DEG_graph_relations_update(depsgraph, bmain, scene_new); DEG_on_visible_update(bmain, false); ED_screen_update_after_scene_change(active_screen, scene_new); ED_render_engine_changed(bmain); - ED_update_for_newframe(bmain, scene_new); + ED_update_for_newframe(bmain, scene_new, depsgraph); /* complete redraw */ WM_event_add_notifier(C, NC_WINDOW, NULL); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index e6bdd0e83b5..5e0afe0ec39 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1726,7 +1726,7 @@ void ED_screen_animation_timer_update(bScreen *screen, int redraws, int refresh) } /* results in fully updated anim system */ -void ED_update_for_newframe(Main *bmain, Scene *scene) +void ED_update_for_newframe(Main *bmain, Scene *scene, struct Depsgraph *depsgraph) { #ifdef DURIAN_CAMERA_SWITCH void *camera = BKE_scene_camera_switch_find(scene); @@ -1743,7 +1743,7 @@ void ED_update_for_newframe(Main *bmain, Scene *scene) ED_clip_update_frame(bmain, scene->r.cfra); /* this function applies the changes too */ - BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene); /* composite */ if (scene->use_nodes && scene->nodetree) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 4f89fd45a6b..9352fcc76f7 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3518,7 +3518,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv } /* since we follow drawflags, we can't send notifier but tag regions ourselves */ - ED_update_for_newframe(bmain, scene); + ED_update_for_newframe(bmain, scene, CTX_data_depsgraph(C)); for (window = wm->windows.first; window; window = window->next) { const bScreen *win_screen = WM_window_get_active_screen(window); diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index 755cda94128..cd8e92c9b9c 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -297,7 +297,8 @@ static void track_markers_endjob(void *tmv) tmj->scene->r.cfra = BKE_movieclip_remap_clip_to_scene_frame(tmj->clip, tmj->lastfra); if (wm != NULL) { - ED_update_for_newframe(tmj->main, tmj->scene); + // XXX: ... + // ED_update_for_newframe(tmj->main, tmj->scene); } BKE_autotrack_context_sync(tmj->context); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 991c61a77cc..4588f5c60ca 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1574,7 +1574,7 @@ static int game_engine_exec(bContext *C, wmOperator *op) //XXX restore_all_scene_cfra(scene_cfra_store); BKE_scene_set_background(CTX_data_main(C), startscene); - //XXX BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene); + //XXX BKE_scene_graph_update_for_newframe(bmain->eval_ctx, bmain, scene, depsgraph); BLI_callback_exec(bmain, &startscene->id, BLI_CB_EVT_GAME_POST); diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 354d796f2e0..3f9c3293f8d 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -76,6 +76,7 @@ const char *BlenderStrokeRenderer::uvNames[] = {"along_stroke", "along_stroke_ti BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : StrokeRenderer() { freestyle_bmain = re->freestyle_bmain; + freestyle_depsgraph = DEG_graph_new(); // for stroke mesh generation _width = re->winx; @@ -123,15 +124,19 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str printf("%s: %d thread(s)\n", __func__, BKE_render_num_threads(&freestyle_scene->r)); } + BKE_scene_set_background(freestyle_bmain, freestyle_scene); + DEG_graph_id_tag_update(freestyle_bmain, freestyle_depsgraph, &freestyle_scene->id, 0); + // Render layer SceneRenderLayer *srl = (SceneRenderLayer *)freestyle_scene->r.layers.first; srl->layflag = SCE_LAY_SOLID | SCE_LAY_ZTRA; - BKE_scene_set_background(freestyle_bmain, freestyle_scene); + // Scene layer. + SceneLayer *scene_layer = (SceneLayer *)freestyle_scene->render_layers.first; // Camera - Object *object_camera = BKE_object_add(freestyle_bmain, freestyle_scene, (SceneLayer *)freestyle_scene->render_layers.first, OB_CAMERA, NULL); - DEG_relations_tag_update(freestyle_bmain); + Object *object_camera = BKE_object_add(freestyle_bmain, freestyle_scene, scene_layer, OB_CAMERA, NULL); + DEG_graph_id_tag_update(freestyle_bmain, freestyle_depsgraph, &object_camera->id, 0); Camera *camera = (Camera *)object_camera->data; camera->type = CAM_ORTHO; @@ -159,6 +164,9 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str _nodetree_hash = BLI_ghash_ptr_new("BlenderStrokeRenderer::_nodetree_hash"); else _nodetree_hash = NULL; + + // New IDs were added, tag relations for update. + DEG_graph_tag_relations_update(freestyle_depsgraph); } BlenderStrokeRenderer::~BlenderStrokeRenderer() @@ -225,6 +233,8 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer() if (_use_shading_nodes) BLI_ghash_free(_nodetree_hash, NULL, NULL); + DEG_graph_free(freestyle_depsgraph); + FreeStrokeGroups(); } @@ -943,9 +953,12 @@ Object *BlenderStrokeRenderer::NewMesh() const BKE_collection_object_add(freestyle_scene, sc_master, ob); BKE_scene_base_add(freestyle_scene, ob); - DEG_relations_tag_update(freestyle_bmain); + DEG_graph_tag_relations_update(freestyle_depsgraph); - DEG_id_tag_update_ex(freestyle_bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + DEG_graph_id_tag_update(freestyle_bmain, + freestyle_depsgraph, + &ob->id, + OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); return ob; } @@ -962,9 +975,8 @@ Render *BlenderStrokeRenderer::RenderScene(Render * /*re*/, bool render) #endif Render *freestyle_render = RE_NewSceneRender(freestyle_scene); - DEG_scene_relations_update(freestyle_bmain, freestyle_scene); - /* Need to get proper depsgraph. */ - freestyle_render->depsgraph = freestyle_scene->depsgraph_legacy; + DEG_graph_relations_update(freestyle_depsgraph, freestyle_bmain, freestyle_scene); + freestyle_render->depsgraph = freestyle_depsgraph; RE_RenderFreestyleStrokes(freestyle_render, freestyle_bmain, freestyle_scene, render && get_stroke_count() > 0); diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h index ec53efa14cd..c7204293839 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h @@ -29,6 +29,7 @@ #include "../system/FreestyleConfig.h" extern "C" { +struct Depsgraph; struct GHash; struct Main; struct Material; @@ -76,6 +77,7 @@ protected: Main *freestyle_bmain; Scene *old_scene; Scene *freestyle_scene; + Depsgraph *freestyle_depsgraph; bContext *_context; float _width, _height; float _z, _z_delta; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 76daa635df2..d7737381c46 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -5220,14 +5220,14 @@ void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int l /* applies changes fully */ if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) { - BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene); render_update_anim_renderdata(re, &re->scene->r); } /* if no camera, viewmat should have been set! */ if (use_camera_view && camera) { /* called before but need to call again in case of lens animation from the - * above call to BKE_scene_update_for_newframe, fixes bug. [#22702]. + * above call to BKE_scene_graph_update_for_newframe, fixes bug. [#22702]. * following calls don't depend on 'RE_SetCamera' */ RE_SetCamera(re, camera); RE_GetCameraModelMatrix(re, camera, mat); @@ -5392,7 +5392,7 @@ static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int la /* applies changes fully */ scene->r.cfra += timeoffset; - BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene); /* if no camera, viewmat should have been set! */ if (camera) { diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c index 15a49480d1a..28c0c1cbf14 100644 --- a/source/blender/render/intern/source/external_engine.c +++ b/source/blender/render/intern/source/external_engine.c @@ -622,7 +622,7 @@ void RE_engine_frame_set(RenderEngine *engine, int frame, float subframe) BPy_BEGIN_ALLOW_THREADS; #endif - BKE_scene_update_for_newframe(re->eval_ctx, re->main, scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, scene); #ifdef WITH_PYTHON BPy_END_ALLOW_THREADS; @@ -657,7 +657,7 @@ int RE_engine_render(Render *re, int do_all) /* update animation here so any render layer animation is applied before * creating the render result */ if ((re->r.scemode & (R_NO_FRAME_UPDATE | R_BUTS_PREVIEW)) == 0) { - BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene); render_update_anim_renderdata(re, &re->scene->r); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 4bd0b78f8e3..61817f08f16 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1746,7 +1746,7 @@ static void do_render_blur_3d(Render *re) /* make sure motion blur changes get reset to current frame */ if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW))==0) { - BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene); } /* weak... the display callback wants an active renderlayer pointer... */ @@ -2633,7 +2633,7 @@ static void do_render_composite_fields_blur_3d(Render *re) R.i.cfra = re->i.cfra; if (update_newframe) - BKE_scene_update_for_newframe(re->eval_ctx, re->main, re->scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, re->main, re->scene); if (re->r.scemode & R_FULL_SAMPLE) do_merge_fullsample(re, ntree); @@ -3698,7 +3698,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri if (nfra != scene->r.cfra) { /* Skip this frame, but update for physics and particles system. */ - BKE_scene_update_for_newframe(re->eval_ctx, bmain, scene); + BKE_scene_graph_update_for_newframe(re->eval_ctx, re->depsgraph, bmain, scene); continue; } else diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 2c3d36cdcfb..7167e61fccd 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -394,12 +394,12 @@ void wm_event_do_notifiers(bContext *C) if (do_anim) { /* XXX, quick frame changes can cause a crash if framechange and rendering - * collide (happens on slow scenes), BKE_scene_update_for_newframe can be called + * collide (happens on slow scenes), BKE_scene_graph_update_for_newframe can be called * twice which can depgraph update the same object at once */ if (G.is_rendering == false) { /* depsgraph gets called, might send more notifiers */ - ED_update_for_newframe(CTX_data_main(C), scene); + ED_update_for_newframe(CTX_data_main(C), scene, CTX_data_depsgraph(C)); } } } @@ -2619,7 +2619,7 @@ void wm_event_do_handlers(bContext *C) int ncfra = time * (float)FPS + 0.5f; if (ncfra != scene->r.cfra) { scene->r.cfra = ncfra; - ED_update_for_newframe(CTX_data_main(C), scene); + ED_update_for_newframe(CTX_data_main(C), scene, CTX_data_depsgraph(C)); WM_event_add_notifier(C, NC_WINDOW, NULL); } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 814be6a1d32..8600bc63cb7 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3240,7 +3240,7 @@ static const EnumPropertyItem redraw_timer_type_items[] = { static void redraw_timer_step( - bContext *C, Main *bmain, Scene *scene, + bContext *C, Main *bmain, Scene *scene, struct Depsgraph *depsgraph, wmWindow *win, ScrArea *sa, ARegion *ar, const int type, const int cfra) { @@ -3287,7 +3287,7 @@ static void redraw_timer_step( } else if (type == eRTAnimationStep) { scene->r.cfra += (cfra == scene->r.cfra) ? 1 : -1; - BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene); } else if (type == eRTAnimationPlay) { /* play anim, return on same frame as started with */ @@ -3299,7 +3299,7 @@ static void redraw_timer_step( if (scene->r.cfra > scene->r.efra) scene->r.cfra = scene->r.sfra; - BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, scene); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene); redraw_timer_window_swap(C); } } @@ -3323,13 +3323,14 @@ static int redraw_timer_exec(bContext *C, wmOperator *op) const int cfra = scene->r.cfra; int a, iter_steps = 0; const char *infostr = ""; + struct Depsgraph *depsgraph = CTX_data_depsgraph(C); WM_cursor_wait(1); time_start = PIL_check_seconds_timer(); for (a = 0; a < iter; a++) { - redraw_timer_step(C, bmain, scene, win, sa, ar, type, cfra); + redraw_timer_step(C, bmain, scene, depsgraph, win, sa, ar, type, cfra); iter_steps += 1; if (time_limit != 0.0) { |