diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2012-02-27 20:45:48 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2012-02-27 20:45:48 +0400 |
commit | d55c1d59f91a919c8d4b935136454200adb0b8e8 (patch) | |
tree | ce36a1aff7544ca37b09432a4894e1b4fbbdd022 /source/blender | |
parent | d8403875ccc422c88e6d46090033e3e31a0da02b (diff) |
Fix: confirming edge slide with factor 0 and automerge turned on would delete the selected edges. Caused by automerging the edges with temporary geometry used for the operation, that was getting deleted later. Now deleting the temporary geometry before automerging.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform.c | 30 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 3 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 5 |
3 files changed, 29 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9b971376846..c9cb6c79066 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4631,6 +4631,7 @@ static int createSlideVerts(TransInfo *t) BLI_smallhash_insert(&sld->vhash, (uintptr_t)tempsv->v, tempsv); } + sld->origfaces_init = TRUE; sld->em = em; /*zero out start*/ @@ -4742,11 +4743,26 @@ void projectSVData(TransInfo *t, int final) BLI_smallhash_release(&visit); } +void freeSlideTempFaces(SlideData *sld){ + if(sld->origfaces_init){ + SmallHashIter hiter; + BMFace *copyf; + + copyf = BLI_smallhash_iternew(&sld->origfaces, &hiter, NULL); + for (; copyf; copyf=BLI_smallhash_iternext(&hiter, NULL)) { + BM_face_verts_kill(sld->em->bm, copyf); + } + + BLI_smallhash_release(&sld->origfaces); + + sld->origfaces_init = FALSE; + } +} + + void freeSlideVerts(TransInfo *t) { SlideData *sld = t->customData; - SmallHashIter hiter; - BMFace *copyf; #if 0 /*BMESH_TODO*/ if(me->drawflag & ME_DRAWEXTRA_EDGELEN) { @@ -4776,17 +4792,13 @@ void freeSlideVerts(TransInfo *t) sld->perc = 0.0; projectSVData(t, 0); } - - copyf = BLI_smallhash_iternew(&sld->origfaces, &hiter, NULL); - for (; copyf; copyf=BLI_smallhash_iternext(&hiter, NULL)) { - BM_face_verts_kill(sld->em->bm, copyf); - } - + + freeSlideTempFaces(sld); + sld->em->bm->ob = t->obedit; bmesh_edit_end(sld->em->bm, BMO_OP_FLAG_UNTAN_MULTIRES); BLI_smallhash_release(&sld->vhash); - BLI_smallhash_release(&sld->origfaces); MEM_freeN(sld->sv); MEM_freeN(sld); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 3397230b080..42a8ebef692 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -203,6 +203,8 @@ typedef struct SlideData { int start[2], end[2]; struct BMEditMesh *em; float perc; + /* flag that is set when origfaces is initialized */ + int origfaces_init; } SlideData; typedef struct TransData { @@ -692,6 +694,7 @@ void applyTransformOrientation(const struct bContext *C, float mat[3][3], char * int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3], int activeOnly); +void freeSlideTempFaces(SlideData *sld); void freeSlideVerts(TransInfo *t); #endif diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5598d70ee70..fe4574921ca 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4873,6 +4873,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t) if (t->spacetype==SPACE_VIEW3D) { if (t->obedit) { if (cancelled==0) { + /* we need to delete the temporary faces before automerging */ + if(t->mode == TFM_EDGE_SLIDE){ + SlideData *sld = t->customData; + freeSlideTempFaces(sld); + } EDBM_automerge(t->scene, t->obedit, 1); } } |