diff options
-rw-r--r-- | source/blender/blenkernel/BKE_tessmesh.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 7 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_slide.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 3 |
4 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_tessmesh.h b/source/blender/blenkernel/BKE_tessmesh.h index 3a806651d61..dea5e726671 100644 --- a/source/blender/blenkernel/BKE_tessmesh.h +++ b/source/blender/blenkernel/BKE_tessmesh.h @@ -72,10 +72,12 @@ typedef struct BMEditMesh { short selectmode; short mat_nr; - /*Mesh structure this editmesh came from, if it came from one*/ - struct Mesh *me; + /* Object this editmesh came from (if it came from one) */ struct Object *ob; + /* Unused for now, we could bring it back and assign in the same way 'ob' is */ + // struct Mesh *me; + /*temp variables for x-mirror editing*/ int mirror_cdlayer; /* -1 is invalid */ int mirr_free_arrays; diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 1577faccf40..befec1907da 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -1747,10 +1747,11 @@ DerivedMesh *getEditDerivedBMesh(BMEditMesh *em, BMEditMesh *BMEdit_FromObject(Object *ob) { BLI_assert(ob->type == OB_MESH); + /* sanity check */ #ifndef NDEBUG -// if (((Mesh *)ob->data)->edit_btmesh) { -// BLI_assert(((Mesh *)ob->data)->edit_btmesh->me == ob->data); -// } + if (((Mesh *)ob->data)->edit_btmesh) { + BLI_assert(((Mesh *)ob->data)->edit_btmesh->ob == ob); + } #endif return ((Mesh *)ob->data)->edit_btmesh; } diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c index 40c1ea7eff2..86ea5bc8651 100644 --- a/source/blender/editors/mesh/editmesh_slide.c +++ b/source/blender/editors/mesh/editmesh_slide.c @@ -208,7 +208,7 @@ static void vtx_slide_confirm(bContext *C, wmOperator *op) other = BM_edge_other_vert(vso->sel_edge, vso->start_vtx); } - if (em->me->editflag & ME_EDIT_MIRROR_X) { + if (((Mesh *)em->ob->data)->editflag & ME_EDIT_MIRROR_X) { EDBM_verts_mirror_cache_begin(em, TRUE); mirr_vtx = EDBM_verts_mirror_get(em, vso->start_vtx); @@ -255,7 +255,7 @@ static void vtx_slide_confirm(bContext *C, wmOperator *op) BM_select_history_store(em->bm, vso->start_vtx); } - if (em->me->editflag & ME_EDIT_MIRROR_X) { + if (((Mesh *)em->ob->data)->editflag & ME_EDIT_MIRROR_X) { EDBM_verts_mirror_cache_end(em); } diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 290ef3baba3..03e2f2691a8 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -345,7 +345,6 @@ void EDBM_mesh_make(ToolSettings *ts, Scene *UNUSED(scene), Object *ob) me->edit_btmesh->selectmode = me->edit_btmesh->bm->selectmode = ts->selectmode; me->edit_btmesh->mat_nr = (ob->actcol > 0) ? ob->actcol - 1 : 0; - me->edit_btmesh->me = me; me->edit_btmesh->ob = ob; } @@ -1056,7 +1055,7 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index) #define BM_CD_LAYER_ID "__mirror_index" void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const short use_select) { - Mesh *me = em->me; + Mesh *me = (Mesh *)em->ob->data; BMesh *bm = em->bm; BMIter iter; BMVert *v; |