From 2ce94cc24b2ce5fdb89ae5d503aaabe22687e285 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 1 May 2018 10:14:20 +0200 Subject: Fix crash opening files saved in sculpt/vertex paint modes Skip access to any evaluated data when operator is run on file load, we don't have depsgraph evaluated yet. In this case we skip part of sculpt session initialization, since it will be done during depsgraph evaluation which happens after DEG_on_visible_update(). We can not skip sculpt session initialization since during normal operation we want all the data to be initialized on mode change, and not on initial brush stroke. --- source/blender/editors/sculpt_paint/sculpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/sculpt_paint/sculpt.c') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1d1c8460cfd..9817ca41832 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5793,7 +5793,7 @@ void ED_object_sculptmode_exit(bContext *C) static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_depsgraph_on_load(C); Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); const int mode_flag = OB_MODE_SCULPT; -- cgit v1.2.3