diff options
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 14 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 24 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_slide.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 4 |
6 files changed, 25 insertions, 29 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 2a8de974b82..1f272e83023 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -556,7 +556,6 @@ static void knife_get_vert_faces(knifetool_opdata *kcd, KnifeVert *kfv, BMFace * knife_append_list(kcd, lst, facef); } else if (kfv->v) { - BMesh *bm = kcd->em->bm; BM_ITER_ELEM (f, &bmiter, kfv->v, BM_FACES_OF_VERT) { knife_append_list(kcd, lst, f); } @@ -569,7 +568,6 @@ static void knife_get_edge_faces(knifetool_opdata *kcd, KnifeEdge *kfe, ListBase BMFace *f; if (kfe->e) { - BMesh *bm = kcd->em->bm; BM_ITER_ELEM (f, &bmiter, kfe->e, BM_FACES_OF_EDGE) { knife_append_list(kcd, lst, f); } @@ -1972,7 +1970,7 @@ static void knifenet_fill_faces(knifetool_opdata *kcd) BMO_elem_flag_disable(bm, f2, DEL); BM_elem_index_set(f2, i); /* set_dirty! *//* note, not 100% sure this is dirty? need to check */ - BM_face_normal_update(bm, f2); + BM_face_normal_update(f2); if (dot_v3v3(f->no, f2->no) < 0.0f) { BM_face_normal_flip(bm, f2); } @@ -2395,9 +2393,9 @@ static int find_hole_chains(knifetool_opdata *kcd, ListBase *hole, BMFace *f, Li } } -static int knife_edge_in_face(knifetool_opdata *kcd, KnifeEdge *kfe, BMFace *f) +static int knife_edge_in_face(knifetool_opdata *UNUSED(kcd), KnifeEdge *kfe, BMFace *f) { - BMesh *bm = kcd->em->bm; + /* BMesh *bm = kcd->em->bm; */ /* UNUSED */ BMVert *v1, *v2; BMLoop *l1, *l2, *l; float mid[3]; @@ -2421,8 +2419,8 @@ static int knife_edge_in_face(knifetool_opdata *kcd, KnifeEdge *kfe, BMFace *f) } /* BM_face_point_inside_test uses best-axis projection so this isn't most accurate test... */ - v1inside = l1 ? 0 : BM_face_point_inside_test(bm, f, kfe->v1->co); - v2inside = l2 ? 0 : BM_face_point_inside_test(bm, f, kfe->v2->co); + v1inside = l1 ? 0 : BM_face_point_inside_test(f, kfe->v1->co); + v2inside = l2 ? 0 : BM_face_point_inside_test(f, kfe->v2->co); if ((l1 && v2inside) || (l2 && v1inside) || (v1inside && v2inside)) return TRUE; if (l1 && l2) { @@ -2431,7 +2429,7 @@ static int knife_edge_in_face(knifetool_opdata *kcd, KnifeEdge *kfe, BMFace *f) * but it is expensive and maybe a bit buggy, so use a simple * "is the midpoint in the face" test */ mid_v3_v3v3(mid, kfe->v1->co, kfe->v2->co); - return BM_face_point_inside_test(bm, f, mid); + return BM_face_point_inside_test(f, mid); } return FALSE; } diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 27e3e643be1..d05bf10e206 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -134,7 +134,7 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg) /* given two opposite edges in a face, finds the ordering of their vertices so * that cut preview lines won't cross each other */ -static void edgering_find_order(BMEditMesh *em, BMEdge *lasteed, BMEdge *eed, +static void edgering_find_order(BMEdge *lasteed, BMEdge *eed, BMVert *lastv1, BMVert *v[2][2]) { BMIter liter; @@ -237,7 +237,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) lastv1 = lasteed->v1; } - edgering_find_order(em, lasteed, eed, lastv1, v); + edgering_find_order(lasteed, eed, lastv1, v); lastv1 = v[0][0]; BLI_array_growitems(edges, previewlines); @@ -263,7 +263,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select) v[1][0] = v[0][0]; v[1][1] = v[0][1]; - edgering_find_order(em, lasteed, startedge, lastv1, v); + edgering_find_order(lasteed, startedge, lastv1, v); BLI_array_growitems(edges, previewlines); diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 9ae816903f2..43e9b885037 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -154,7 +154,7 @@ static float edbm_rip_edge_side_measure(BMEdge *e, #define INVALID_UID INT_MIN /* mark, assign uid and step */ -static BMEdge *edbm_ripsel_edge_mark_step(BMesh *bm, BMVert *v, const int uid) +static BMEdge *edbm_ripsel_edge_mark_step(BMVert *v, const int uid) { BMIter iter; BMEdge *e; @@ -230,7 +230,7 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm) v_step = e_first->v1; uid_start = uid; - while ((e = edbm_ripsel_edge_mark_step(bm, v_step, uid))) { + while ((e = edbm_ripsel_edge_mark_step(v_step, uid))) { BM_elem_flag_disable(e, BM_ELEM_SMOOTH); v_step = BM_edge_other_vert((e_step = e), v_step); uid++; /* only different line */ @@ -247,7 +247,7 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm) /* initialize */ v_step = e_first->v1; - while ((e = edbm_ripsel_edge_mark_step(bm, v_step, uid))) { + while ((e = edbm_ripsel_edge_mark_step(v_step, uid))) { BM_elem_flag_disable(e, BM_ELEM_SMOOTH); v_step = BM_edge_other_vert((e_step = e), v_step); uid--; /* only different line */ @@ -283,7 +283,7 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm) /* - De-Select the worst rip-edge side -------------------------------- */ -static BMEdge *edbm_ripsel_edge_uid_step(BMesh *bm, BMEdge *e_orig, BMVert **v_prev) +static BMEdge *edbm_ripsel_edge_uid_step(BMEdge *e_orig, BMVert **v_prev) { BMIter eiter; BMEdge *e; @@ -299,11 +299,11 @@ static BMEdge *edbm_ripsel_edge_uid_step(BMesh *bm, BMEdge *e_orig, BMVert **v_p return NULL; } -static BMVert *edbm_ripsel_edloop_pair_start_vert(BMesh *bm, BMEdge *e) +static BMVert *edbm_ripsel_edloop_pair_start_vert(BMEdge *e) { /* try step in a direction, if it fails we know do go the other way */ BMVert *v_test = e->v1; - return (edbm_ripsel_edge_uid_step(bm, e, &v_test)) ? e->v1 : e->v2; + return (edbm_ripsel_edge_uid_step(e, &v_test)) ? e->v1 : e->v2; } static void edbm_ripsel_deselect_helper(BMesh *bm, EdgeLoopPair *eloop_pairs, @@ -319,19 +319,19 @@ static void edbm_ripsel_deselect_helper(BMesh *bm, EdgeLoopPair *eloop_pairs, float score_b = 0.0f; e = lp->l_a->e; - v_prev = edbm_ripsel_edloop_pair_start_vert(bm, e); - for (; e; e = edbm_ripsel_edge_uid_step(bm, e, &v_prev)) { + v_prev = edbm_ripsel_edloop_pair_start_vert(e); + for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) { score_a += edbm_rip_edge_side_measure(e, ar, projectMat, fmval); } e = lp->l_b->e; - v_prev = edbm_ripsel_edloop_pair_start_vert(bm, e); - for (; e; e = edbm_ripsel_edge_uid_step(bm, e, &v_prev)) { + v_prev = edbm_ripsel_edloop_pair_start_vert(e); + for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) { score_b += edbm_rip_edge_side_measure(e, ar, projectMat, fmval); } e = (score_a > score_b) ? lp->l_a->e : lp->l_b->e; - v_prev = edbm_ripsel_edloop_pair_start_vert(bm, e); - for (; e; e = edbm_ripsel_edge_uid_step(bm, e, &v_prev)) { + v_prev = edbm_ripsel_edloop_pair_start_vert(e); + for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) { BM_elem_select_set(bm, e, FALSE); } } diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 52547c120c0..d6aa3f48b85 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2578,7 +2578,7 @@ void MESH_OT_region_to_loop(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int loop_find_region(BMEditMesh *em, BMLoop *l, int flag, +static int loop_find_region(BMLoop *l, int flag, SmallHash *fhash, BMFace ***region_out) { BLI_array_declare(region); @@ -2676,7 +2676,7 @@ static int loop_find_regions(BMEditMesh *em, int selbigger) if (BLI_smallhash_haskey(&visithash, (uintptr_t)l->f)) continue; - c = loop_find_region(em, l, BM_ELEM_SELECT, &visithash, ®ion_out); + c = loop_find_region(l, BM_ELEM_SELECT, &visithash, ®ion_out); if (!region || (selbigger ? c >= tot : c < tot)) { /* this region is the best seen so far */ diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c index dd68cd30cf5..6534210601c 100644 --- a/source/blender/editors/mesh/editmesh_slide.c +++ b/source/blender/editors/mesh/editmesh_slide.c @@ -486,8 +486,6 @@ static int vtx_slide_set_frame(VertexSlideOp *vso) BLI_array_declare(vtx_frame); BLI_array_declare(edge_frame); BMIter iter; - BMEditMesh *em = BMEdit_FromObject(vso->obj); - BMesh *bm = em->bm; BMVert *sel_vtx = vso->start_vtx; int idx = 0; diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index b006f77200e..468f5699bce 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -1270,9 +1270,9 @@ void EDBM_update_generic(bContext *C, BMEditMesh *em, const short do_tessface) * need (at the moment) to wrap them, but on the other hand having these * wrapped avoids a confusing mess of mixing BM_ and EDBM_ namespaces. */ -void EDBM_editselection_center(BMEditMesh *em, float *center, BMEditSelection *ese) +void EDBM_editselection_center(float *center, BMEditSelection *ese) { - BM_editselection_center(em->bm, center, ese); + BM_editselection_center(center, ese); } void EDBM_editselection_normal(float *normal, BMEditSelection *ese) |