Fix T69404: Merge by distance crash with Unselected
Error introduced when removing the automerge bmesh operator.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user