From fc691cdb5e0c23bf36e68a14903d6bc4d0cc5242 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 4 Dec 2006 03:26:30 +0000 Subject: [PATCH] Fix for bug #5345, sculpt tool doesn't seems to use correctly the undo setting on the global preferences --- source/blender/src/multires.c | 5 ++++- source/blender/src/sculptmode.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/source/blender/src/multires.c b/source/blender/src/multires.c index 4a0c058f54c..e9e763f10ae 100644 --- a/source/blender/src/multires.c +++ b/source/blender/src/multires.c @@ -1063,8 +1063,11 @@ void multires_level_to_mesh(Object *ob, Mesh *me) /* Vertices/Edges/Faces */ for(i=0; itotvert; ++i) { - if(em) + if(em) { eves[i]= addvertlist(lvl->verts[i].co, NULL); /* TODO */ + if(lvl->verts[i].flag & 1) eves[i]->f |= SELECT; + if(lvl->verts[i].flag & ME_HIDE) eves[i]->h= 1; + } else me->mvert[i]= lvl->verts[i]; } diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index 14d3e675b22..3b2c46e6222 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -301,10 +301,17 @@ void sculptmode_undo_free(Scene *sce) void sculptmode_undo_push(char *str, SculptUndoType type) { - int cnt= 7; + int cnt= U.undosteps-1; SculptUndo *su= G.scene->sculptdata.undo; - SculptUndoStep *n= MEM_callocN(sizeof(SculptUndoStep), "SculptUndo"), *sus, *chop, *path; + SculptUndoStep *n, *sus, *chop, *path; Mesh *me= get_mesh(G.scene->sculptdata.active_ob); + + if(U.undosteps==0) { + sculptmode_undo_free(G.scene); + return; + } + + n= MEM_callocN(sizeof(SculptUndoStep), "SculptUndo"); /* Chop off undo data after cur */ for(sus= su->steps.last; sus && sus != su->cur; sus= path) {