diff options
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_automerge.c | 11 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 7 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 5 |
4 files changed, 13 insertions, 18 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index f2ef3a60bc5..ee4798430ef 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -139,13 +139,13 @@ bool BMBVH_EdgeVisible(struct BMBVHTree *tree, struct Object *obedit); /* editmesh_automerge.c */ -void EDBM_automerge(struct Scene *scene, struct Object *ob, bool update, const char hflag); -void EDBM_automerge_and_split(struct Scene *scene, - struct Object *ob, +void EDBM_automerge(struct Object *ob, bool update, const char hflag, const float dist); +void EDBM_automerge_and_split(struct Object *ob, bool split_edges, bool split_faces, bool update, - const char hflag); + const char hflag, + const float dist); /* editmesh_undo.c */ void ED_mesh_undosys_type(struct UndoType *ut); diff --git a/source/blender/editors/mesh/editmesh_automerge.c b/source/blender/editors/mesh/editmesh_automerge.c index 62f4fc6bb7d..82f53aafad8 100644 --- a/source/blender/editors/mesh/editmesh_automerge.c +++ b/source/blender/editors/mesh/editmesh_automerge.c @@ -54,7 +54,7 @@ * Used after transform operations. * \{ */ -void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag) +void EDBM_automerge(Object *obedit, bool update, const char hflag, const float dist) { BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; @@ -69,7 +69,7 @@ void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag) BMO_FLAG_DEFAULTS, "find_doubles verts=%av keep_verts=%Hv dist=%f", hflag, - scene->toolsettings->doublimit); + dist); BMO_op_exec(bm, &findop); @@ -286,18 +286,17 @@ static int edbm_automerge_and_split_sort_cmp_by_keys_cb(const void *index1_v, } } -void EDBM_automerge_and_split(Scene *scene, - Object *obedit, +void EDBM_automerge_and_split(Object *obedit, bool split_edges, bool split_faces, bool update, - const char hflag) + const char hflag, + const float dist) { bool ok = false; BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; - float dist = scene->toolsettings->doublimit; BMOperator findop, weldop; BMOpSlot *slot_targetmap; BMIter iter; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index b88b6cbb3a6..e5023068100 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3131,12 +3131,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op) BM_mesh_elem_hflag_enable_test(em->bm, htype_select, BM_ELEM_TAG, true, true, BM_ELEM_SELECT); if (use_unselected) { - EDBM_op_init(em, &bmop, op, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, threshold); - BMO_op_exec(em->bm, &bmop); - - if (!EDBM_op_finish(em, &bmop, op, true)) { - continue; - } + EDBM_automerge(obedit, false, BM_ELEM_SELECT, threshold); } else { EDBM_op_init(em, &bmop, op, "find_doubles verts=%hv dist=%f", BM_ELEM_SELECT, threshold); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 887d4bcf0e8..328cb1d1bbf 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -7128,10 +7128,11 @@ static void special_aftertrans_update__mesh(bContext *UNUSED(C), TransInfo *t) if (t->scene->toolsettings->automerge & AUTO_MERGE) { if (t->scene->toolsettings->automerge & AUTO_MERGE_AND_SPLIT) { - EDBM_automerge_and_split(t->scene, tc->obedit, true, true, true, hflag); + EDBM_automerge_and_split( + tc->obedit, true, true, true, hflag, t->scene->toolsettings->doublimit); } else { - EDBM_automerge(t->scene, tc->obedit, true, hflag); + EDBM_automerge(tc->obedit, true, hflag, t->scene->toolsettings->doublimit); } } |