Fix T72028: Crash switching to vertex paint

This would happen when done from editmode, on a mesh with any modifier,
after adding/removing geometry in editmode.

Similar to rBba0870713b9b (which did this for weightpaint and sculpt
already), ensure an evaluated depsgraph, otherwise
'runtime.mesh_deform_eval' would not be up to date causing problems
later.

Maniphest Tasks: T72028

Differential Revision: https://developer.blender.org/D7011
This commit is contained in:
Philipp Oeser 2020-03-03 17:22:52 +01:00 committed by Nathan Letwory
parent 41c11fb265
commit c7e28f25d5
No known key found for this signature in database
GPG Key ID: 2C99F9D5FC4EFA4C
Notes: blender-bot 2023-02-14 03:31:57 +01:00
Referenced by issue #72028, Crash switching to vertex paint (from editmode, mesh with modifier, after adding/removing geometry in editmode)
1 changed files with 3 additions and 0 deletions

View File

@ -2529,6 +2529,9 @@ static int vpaint_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_vpaintmode_enter_ex(bmain, depsgraph, wm, scene, ob);
BKE_paint_toolslots_brush_validate(bmain, &ts->vpaint->paint);