diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-04-03 22:41:40 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-04-03 22:41:40 +0400 |
commit | c86b17ddb7c64e396670e9ef3a8233ec287daf22 (patch) | |
tree | 11f0d4d92793f9b0d76ff55886c581868ecfb777 /source | |
parent | 51afa3b7c67e33f089da192d05be5ec1dd9969b6 (diff) |
Fix bug #30778, sculpt w/ modifiers + undo causes collapse of vertices
Was caused by earlier refactoring of undo, used index array
before it gets initialized. Fixed by swapping order of copying.
Also changed normals calculation on undo restore to operate on
tessellated data (which sculpt still uses), fixes console warning
print.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 5378ce7872a..89a786d02a9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -274,7 +274,8 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) if (ss->modifiers_active) { Mesh *mesh = ob->data; - mesh_calc_normals_mapping(mesh->mvert, mesh->totvert, mesh->mloop, mesh->mpoly, mesh->totloop, mesh->totpoly, NULL, NULL, 0, NULL, NULL); + mesh_calc_normals_tessface(mesh->mvert, mesh->totvert, + mesh->mface, mesh->totface, NULL); free_sculptsession_deformMats(ss); tag_update |= 1; @@ -471,14 +472,6 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, BLI_unlock_thread(LOCK_CUSTOM1); /* copy threaded, hopefully this is the performance critical part */ - switch (type) { - case SCULPT_UNDO_COORDS: - sculpt_undo_store_coords(ob, unode); - break; - case SCULPT_UNDO_HIDDEN: - sculpt_undo_store_hidden(ob, unode); - break; - } if (unode->grids) { int totgrid, *grids; @@ -493,6 +486,15 @@ SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, memcpy(unode->index, vert_indices, sizeof(int) * unode->totvert); } + switch (type) { + case SCULPT_UNDO_COORDS: + sculpt_undo_store_coords(ob, unode); + break; + case SCULPT_UNDO_HIDDEN: + sculpt_undo_store_hidden(ob, unode); + break; + } + /* store active shape key */ if (ss->kb) BLI_strncpy(unode->shapeName, ss->kb->name, sizeof(ss->kb->name)); else unode->shapeName[0] = '\0'; |