diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-18 18:19:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-18 19:19:27 +0300 |
commit | 383c4ba3d83fa706319888c39731a52b3f319ffd (patch) | |
tree | 6e6b7725607c1f73c872c3a5e611805a7773321f /source/blender/editors/curve/editcurve_paint.c | |
parent | 3e230cecf0c5059a9c3db16231b4ad7b10300e92 (diff) |
Fix excessive dependency graph evaluation while painting strokes
Particularly noticeable when vertex painting with a subsurf modifier.
In some cases every sculpt or paint stroke step would evaluate the dependency
graph. This should only happen for redraws. Now more selectively choose if the
dependency graph should be evaluated to initialize the view context. Doing it
in the view context evaluation is somewhat hidden, now it's more explicit.
Differential Revision: https://developer.blender.org/D5844
Diffstat (limited to 'source/blender/editors/curve/editcurve_paint.c')
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index c7c19aa2d02..2bb28fbcc6b 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -575,9 +575,10 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) BLI_assert(op->customdata == NULL); struct CurveDrawData *cdd = MEM_callocN(sizeof(*cdd), __func__); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); if (is_invoke) { - ED_view3d_viewcontext_init(C, &cdd->vc); + ED_view3d_viewcontext_init(C, &cdd->vc, depsgraph); if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) { MEM_freeN(cdd); BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport"); @@ -586,7 +587,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) } else { cdd->vc.bmain = CTX_data_main(C); - cdd->vc.depsgraph = CTX_data_ensure_evaluated_depsgraph(C); + cdd->vc.depsgraph = depsgraph; cdd->vc.scene = CTX_data_scene(C); cdd->vc.view_layer = CTX_data_view_layer(C); cdd->vc.obedit = CTX_data_edit_object(C); |