diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-01 11:10:45 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-01 11:10:45 +0400 |
commit | 1d5a3886a175da808df1872f161e4eb8848ab358 (patch) | |
tree | 0143bc071861f8e715530a37888b9fb7c8ab3406 /source | |
parent | 4dfc25223f7ee61a716e7b46d675f694083a0eb2 (diff) |
Fix crash on edge slide when object has got multires modifier
Issue was caused by fix for slide+automerge bug resulted in accessing to freed memory
from multires projection code. Solved by moving multires projection from cleanup callback
to special_aftertrans_update.
Patch by Antony Riakiotakis with some own corrections.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform.c | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.h | 1 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 16 |
3 files changed, 17 insertions, 10 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index f8782f47ad2..2b2ad563f0a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4783,16 +4783,6 @@ void freeSlideVerts(TransInfo *t) if (!sld) return; - /*handle multires reprojection, done - on transform completion since it's - really slow -joeedh*/ - if (t->state != TRANS_CANCEL) { - projectSVData(t, 1); - } else { - sld->perc = 0.0; - projectSVData(t, 0); - } - freeSlideTempFaces(sld); sld->em->bm->ob = t->obedit; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 545d2348f82..07c90f95840 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -691,5 +691,6 @@ int getTransformOrientation(const struct bContext *C, float normal[3], float pla void freeSlideTempFaces(SlideData *sld); void freeSlideVerts(TransInfo *t); +void projectSVData(TransInfo *t, int final); #endif diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 39a89940e17..4de220af959 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4877,10 +4877,26 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* we need to delete the temporary faces before automerging */ if(t->mode == TFM_EDGE_SLIDE){ SlideData *sld = t->customData; + + /* handle multires reprojection, done + * on transform completion since it's + * really slow -joeedh */ + projectSVData(t, TRUE); + + /* free temporary faces to avoid automerging and deleting + * during cleanup - psy-fi */ freeSlideTempFaces(sld); } EDBM_automerge(t->scene, t->obedit, 1); } + else { + if (t->mode == TFM_EDGE_SLIDE) { + SlideData *sld = t->customData; + + sld->perc = 0.0; + projectSVData(t, FALSE); + } + } } } |