diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-08 19:50:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-08 19:50:42 +0400 |
commit | ff07676b4047719236186e605d6578e1816b6cdc (patch) | |
tree | d8367201058cd81f3b7b6f56f283721596b3f0ca /source/blender/editors/mesh/editmesh_mods.c | |
parent | 66634e2be41be8530bec49b3bab27dfa4ea176d3 (diff) |
bring back automerge - [#19538] automerge editing doesn't work
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index a23a6dde652..4c9f63f910c 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -117,22 +117,26 @@ void EM_select_mirrored(Object *obedit, EditMesh *em) } } -void EM_automerge(int update) +void EM_automerge(Scene *scene, Object *obedit, int update) { -// XXX int len; - -// if ((scene->automerge) && -// (obedit && obedit->type==OB_MESH) && -// (((Mesh*)obedit->data)->mr==NULL) -// ) { -// len = removedoublesflag(1, 1, scene->toolsettings->doublimit); -// if (len) { -// em->totvert -= len; /* saves doing a countall */ -// if (update) { -// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); -// } -// } -// } + Mesh *me= (Mesh*)obedit->data; /* can be NULL */ + int len; + + if ((scene->toolsettings->automerge) && + (obedit && obedit->type==OB_MESH && obedit->mode==OB_MODE_EDIT) && + (me->mr==NULL) + ) { + Mesh *me= (Mesh*)obedit->data; + EditMesh *em= me->edit_mesh; + + len = removedoublesflag(em, 1, 1, scene->toolsettings->doublimit); + if (len) { + em->totvert -= len; /* saves doing a countall */ + if (update) { + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + } + } + } } /* ****************************** SELECTION ROUTINES **************** */ |