Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-02-27 19:49:28 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2011-02-27 19:49:28 +0300
commitb1ef977efff47f68b9dc61ba0bf7c4948515d622 (patch)
treedb9b1b536035c0657f0f1763825330ef365e3703 /source/blender
parentfc0c0169401909ca1118012bfbf9cf613964a632 (diff)
Fixes for undo when suclpting on deformed mesh:
- Invalid shape when deformation mesh was disabled befoe undoing - Crash when deformation modifier was enabled before undoing Still got problems with undoing multires changes when toggling modifiers.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index d88d7a5ac49..a7ea78d8df5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -70,8 +70,10 @@ static void update_cb(PBVHNode *node, void *unused)
static void sculpt_restore_deformed(SculptSession *ss, SculptUndoNode *unode, int uindex, int oindex, float coord[3])
{
- swap_v3_v3(coord, unode->orig_co[uindex]);
- copy_v3_v3(unode->co[uindex], ss->deform_cos[oindex]);
+ if(unode->orig_co) {
+ swap_v3_v3(coord, unode->orig_co[uindex]);
+ copy_v3_v3(unode->co[uindex], ss->deform_cos[oindex]);
+ } else swap_v3_v3(coord, unode->co[uindex]);
}
static void sculpt_undo_restore(bContext *C, ListBase *lb)
@@ -126,7 +128,10 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
for(i=0; i<unode->totvert; i++) {
if(ss->modifiers_active) sculpt_restore_deformed(ss, unode, i, index[i], vertCos[index[i]]);
- else swap_v3_v3(vertCos[index[i]], unode->co[i]);
+ else {
+ if(unode->orig_co) swap_v3_v3(vertCos[index[i]], unode->orig_co[i]);
+ else swap_v3_v3(vertCos[index[i]], unode->co[i]);
+ }
}
/* propagate new coords to keyblock */
@@ -140,7 +145,10 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
} else {
for(i=0; i<unode->totvert; i++) {
if(ss->modifiers_active) sculpt_restore_deformed(ss, unode, i, index[i], mvert[index[i]].co);
- else swap_v3_v3(mvert[index[i]].co, unode->co[i]);
+ else {
+ if(unode->orig_co) swap_v3_v3(mvert[index[i]].co, unode->orig_co[i]);
+ else swap_v3_v3(mvert[index[i]].co, unode->co[i]);
+ }
mvert[index[i]].flag |= ME_VERT_PBVH_UPDATE;
}
}