diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 16:15:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 16:18:48 +0300 |
commit | 52f9023fbffc709346f8adcc0145140ce158221e (patch) | |
tree | 68d7251e78ceba5698904d137672a73526412e80 /source/blender/blenkernel/intern/subsurf_ccg.c | |
parent | 07f004620397fd818d2684d08ff67422d76a92cf (diff) |
Fix weight paint crash
The PBVH was referencing runtime custom data which was freed on refresh.
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index ed23078a9d8..bc54c554ee4 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -73,6 +73,8 @@ #include "BKE_scene.h" #include "BKE_subsurf.h" +#include "DEG_depsgraph_query.h" + #ifndef USE_DYNSIZE # include "BLI_array.h" #endif @@ -2327,7 +2329,9 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) numGrids, &key, (void **) ccgdm->gridFaces, ccgdm->gridFlagMats, ccgdm->gridHidden); } else if (ob->type == OB_MESH) { - Mesh *me = ob->data; + Object *ob_orig = DEG_get_original_object(ob); + Mesh *me = ob_orig->data; + BLI_assert(!(me->id.tag & LIB_TAG_NO_MAIN)); const int looptris_num = poly_to_tri_count(me->totpoly, me->totloop); MLoopTri *looptri; |