BMesh: remove BMEditMesh.ob use for select mirror
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jan 2020 03:45:01 +0000 (14:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Jan 2020 03:45:01 +0000 (14:45 +1100)
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/editmesh_select.c

index e398e5def9e80fe876205446ef0bc76706ae8fb9..e1330f8b9e715623be26a63a275ffe8a50711890 100644 (file)
@@ -154,8 +154,12 @@ void EDBM_automerge_and_split(struct Object *ob,
 void ED_mesh_undosys_type(struct UndoType *ut);
 
 /* editmesh_select.c */
-void EDBM_select_mirrored(
-    struct BMEditMesh *em, const int axis, const bool extend, int *r_totmirr, int *r_totfail);
+void EDBM_select_mirrored(struct BMEditMesh *em,
+                          const struct Mesh *me,
+                          const int axis,
+                          const bool extend,
+                          int *r_totmirr,
+                          int *r_totfail);
 
 struct BMVert *EDBM_vert_find_nearest_ex(struct ViewContext *vc,
                                          float *r_dist,
index 40d57af97aae0998c421e36eded8ac4fe66c8487..ebd8d50cfc396abeba5f1392cd50e2ef28c11b4b 100644 (file)
 /** \name Select Mirror
  * \{ */
 
-void EDBM_select_mirrored(
-    BMEditMesh *em, const int axis, const bool extend, int *r_totmirr, int *r_totfail)
+void EDBM_select_mirrored(BMEditMesh *em,
+                          const Mesh *me,
+                          const int axis,
+                          const bool extend,
+                          int *r_totmirr,
+                          int *r_totfail)
 {
-  Mesh *me = (Mesh *)em->ob->data;
   BMesh *bm = em->bm;
   BMIter iter;
   int totmirr = 0;
   int totfail = 0;
-  bool use_topology = (me && (me->editflag & ME_EDIT_MIRROR_TOPO));
+  bool use_topology = me->editflag & ME_EDIT_MIRROR_TOPO;
 
   *r_totmirr = *r_totfail = 0;
 
@@ -3863,7 +3866,7 @@ static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
 
     for (int axis = 0; axis < 3; axis++) {
       if ((1 << axis) & axis_flag) {
-        EDBM_select_mirrored(em, axis, extend, &tot_mirr_iter, &tot_fail_iter);
+        EDBM_select_mirrored(em, obedit->data, axis, extend, &tot_mirr_iter, &tot_fail_iter);
       }
     }