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:
authorCampbell Barton <ideasman42@gmail.com>2012-10-01 09:19:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-01 09:19:57 +0400
commitdf298490b841b4aa59f887dfd6fe720705cf5ca8 (patch)
tree39d74271028cabbac13527dde3c10d396fc40d93 /source/blender/editors/sculpt_paint/sculpt_undo.c
parenta9efe26ab8ba8eca7f3d73c38e05fa007b665e61 (diff)
mask data is no longer automatically added when sculpting (except when there is a multi-res modifier).
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 25555f2526f..b204fc75255 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -113,7 +113,7 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo
if (kb) {
ob->shapenr = BLI_findindex(&key->block, kb) + 1;
- sculpt_update_mesh_elements(scene, sd, ob, 0);
+ sculpt_update_mesh_elements(scene, sd, ob, 0, FALSE);
WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob);
}
else {
@@ -271,8 +271,21 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
SculptUndoNode *unode;
MultiresModifierData *mmd;
int update = FALSE, rebuild = FALSE;
+ int need_mask = FALSE;
+
+ for (unode = lb->first; unode; unode = unode->next) {
+ if (strcmp(unode->idname, ob->id.name) == 0) {
+ if (unode->type == SCULPT_UNDO_MASK) {
+ /* is possible that we can't do the mask undo (below)
+ * because of the vertex count */
+ need_mask = TRUE;
+ break;
+ }
+ }
+ }
+
+ sculpt_update_mesh_elements(scene, sd, ob, 0, need_mask);
- sculpt_update_mesh_elements(scene, sd, ob, 0);
/* call _after_ sculpt_update_mesh_elements() which may update 'ob->derivedFinal' */
dm = mesh_get_derived_final(scene, ob, 0);