From 383c4ba3d83fa706319888c39731a52b3f319ffd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 18 Sep 2019 17:19:07 +0200 Subject: 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 --- source/blender/editors/sculpt_paint/paint_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/sculpt_paint/paint_image.c') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index f3a6cfa0d5c..2ed1d5d1af7 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -467,12 +467,13 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const float mouse[2]) { + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; PaintOperation *pop = MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */ Brush *brush = BKE_paint_brush(&settings->imapaint.paint); int mode = RNA_enum_get(op->ptr, "mode"); - ED_view3d_viewcontext_init(C, &pop->vc); + ED_view3d_viewcontext_init(C, &pop->vc, depsgraph); copy_v2_v2(pop->prevmouse, mouse); copy_v2_v2(pop->startmouse, mouse); -- cgit v1.2.3