diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-01 11:14:20 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-01 11:14:20 +0300 |
commit | 2ce94cc24b2ce5fdb89ae5d503aaabe22687e285 (patch) | |
tree | 3ae7dd9a443c4205c0ba90f1fbaf3eaf0350ab8e /source/blender/blenkernel/intern/paint.c | |
parent | af508a1e39c002db8e07886e042378c12b8fc136 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 4681f54e26f..4056a15fe47 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -865,6 +865,15 @@ void BKE_sculpt_update_mesh_elements( Depsgraph *depsgraph, Scene *scene, Sculpt *sd, Object *ob, bool need_pmap, bool need_mask) { + if (depsgraph == NULL) { + /* Happens on file load. + * + * We do nothing in this case, it will be taken care about on depsgraph + * evaluation. + */ + return; + } + DerivedMesh *dm; SculptSession *ss = ob->sculpt; Mesh *me = ob->data; |