diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-19 09:27:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-19 09:34:30 +0300 |
commit | 05f3e245a8e1a1ad327c6dc993551cdd832d4e3c (patch) | |
tree | 6f2a93c52b71ab465a2d2cf75f8adf80fc3cdc76 /source/blender/editors/mesh | |
parent | 7f65ab86e59f25e718213287273705cfd34e1746 (diff) |
Fix T54098: Crash existing /w dyntopo sculpt
Optionally don't remap indices for objects.
Checking all objects parent's would reference a freed pointer
while freeing all objects.
In the case of dynamic topology there is no use in keeping track
of hook/vertex-parent indices.
Also disable this when creating meshes for undo storage
since adding an undo step shouldn't be modifying other objects.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4b4f1b2afea..c979a73e964 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3357,7 +3357,11 @@ static int edbm_separate_exec(bContext *C, wmOperator *op) } if (retval_iter) { - BM_mesh_bm_to_me(bm_old, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm_old, me, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); DAG_id_tag_update(&me->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 534ca22178e..11667ed5710 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -496,6 +496,8 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) BM_mesh_bm_to_me( em->bm, &um->me, (&(struct BMeshToMeshParams){ + /* Undo code should not be manipulating 'G.main->object' hooks/vertex-parent. */ + .calc_object_remap = false, .cd_mask_extra = CD_MASK_SHAPE_KEYINDEX, })); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index e407d342603..c4440fa190a 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -380,7 +380,10 @@ void EDBM_mesh_load(Object *ob) bm->shapenr = 1; } - BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm, me, (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); #ifdef USE_TESSFACE_DEFAULT BKE_mesh_tessface_calc(me); |