[Bf-blender-cvs] [ba0870713b9] master: Fix T68268: Crash switching to Weight Paint mode
Campbell Barton
noreply at git.blender.org
Wed Aug 7 20:37:22 CEST 2019
Commit: ba0870713b9b563cb8fcecc9049197bf2dc3d835
Author: Campbell Barton
Date: Thu Aug 8 03:51:24 2019 +1000
Branches: master
https://developer.blender.org/rBba0870713b9b563cb8fcecc9049197bf2dc3d835
Fix T68268: Crash switching to Weight Paint mode
Also applied to sculpt mode
===================================================================
M source/blender/editors/sculpt_paint/paint_vertex.c
M source/blender/editors/sculpt_paint/sculpt.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 32b89f5676f..12da8790b91 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1299,6 +1299,9 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
}
else {
Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C);
+ if (depsgraph) {
+ depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+ }
wmWindowManager *wm = CTX_wm_manager(C);
ED_object_wpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
BKE_paint_toolslots_brush_validate(bmain, &ts->wpaint->paint);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 3567625819f..285e6aff7d0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -6238,6 +6238,9 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
ED_object_sculptmode_exit_ex(bmain, depsgraph, scene, ob);
}
else {
+ if (depsgraph) {
+ depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
+ }
ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, false, op->reports);
BKE_paint_toolslots_brush_validate(bmain, &ts->sculpt->paint);
}
More information about the Bf-blender-cvs
mailing list