From e95c0fba095dfac38b33b5ad7db36316093e2acf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Jan 2020 14:20:49 +1100 Subject: BMesh: remove BMEditMesh.ob use BKE_editmesh_lnorspace_* API Note that this is a bit clumsy having both edit-mesh and mesh, BKE_editmesh_ensure_autosmooth & BKE_editmesh_lnorspace_update are often called together, these could be made into a single functions. --- source/blender/editors/mesh/editmesh_tools.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/mesh') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index a795966693f..54605f4cb68 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -7726,8 +7726,8 @@ static int point_normals_init(bContext *C, wmOperator *op, const wmEvent *UNUSED BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; - BKE_editmesh_ensure_autosmooth(em); - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); + BKE_editmesh_lnorspace_update(em, obedit->data); BMLoopNorEditDataArray *lnors_ed_arr = BM_loop_normal_editdata_array_init(bm, false); op->customdata = lnors_ed_arr; @@ -8293,8 +8293,8 @@ static int normals_split_merge(bContext *C, const bool do_merge) BMEdge *e; BMIter eiter; - BKE_editmesh_ensure_autosmooth(em); - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); + BKE_editmesh_lnorspace_update(em, obedit->data); /* Note that we need temp lnor editing data for all loops of all affected vertices, since by * setting some faces/edges as smooth we are going to change clnors spaces... See also T65809. @@ -8312,7 +8312,7 @@ static int normals_split_merge(bContext *C, const bool do_merge) } bm->spacearr_dirty |= BM_SPACEARR_DIRTY_ALL; - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_lnorspace_update(em, obedit->data); if (do_merge) { normals_merge(bm, lnors_ed_arr); @@ -8417,9 +8417,9 @@ static int edbm_average_normals_exec(bContext *C, wmOperator *op) BMLoop *l, *l_curr, *l_first; BMIter fiter; - BKE_editmesh_ensure_autosmooth(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); bm->spacearr_dirty |= BM_SPACEARR_DIRTY_ALL; - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_lnorspace_update(em, obedit->data); const int cd_clnors_offset = CustomData_get_offset(&bm->ldata, CD_CUSTOMLOOPNORMAL); @@ -8656,8 +8656,8 @@ static int edbm_normals_tools_exec(bContext *C, wmOperator *op) continue; } - BKE_editmesh_ensure_autosmooth(em); - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); + BKE_editmesh_lnorspace_update(em, obedit->data); BMLoopNorEditDataArray *lnors_ed_arr = BM_loop_normal_editdata_array_init(bm, false); BMLoopNorEditData *lnor_ed = lnors_ed_arr->lnor_editdata; @@ -8862,8 +8862,8 @@ static int edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op) const bool keep_sharp = RNA_boolean_get(op->ptr, "keep_sharp"); - BKE_editmesh_ensure_autosmooth(em); - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); + BKE_editmesh_lnorspace_update(em, obedit->data); float(*vnors)[3] = MEM_callocN(sizeof(*vnors) * bm->totvert, __func__); BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { @@ -8965,8 +8965,8 @@ static int edbm_smoothen_normals_exec(bContext *C, wmOperator *op) BMLoop *l; BMIter fiter, liter; - BKE_editmesh_ensure_autosmooth(em); - BKE_editmesh_lnorspace_update(em); + BKE_editmesh_ensure_autosmooth(em, obedit->data); + BKE_editmesh_lnorspace_update(em, obedit->data); BMLoopNorEditDataArray *lnors_ed_arr = BM_loop_normal_editdata_array_init(bm, false); float(*smooth_normal)[3] = MEM_callocN(sizeof(*smooth_normal) * lnors_ed_arr->totloop, -- cgit v1.2.3