[Bf-blender-cvs] [30b5aef] master: Fix T38427: Sculpt mode dimension changes don't Undo

Sergey Sharybin noreply at git.blender.org
Tue Feb 4 14:47:36 CET 2014


Commit: 30b5aef6789a2cf39020151b00410bd1d8f1c3d7
Author: Sergey Sharybin
Date:   Tue Feb 4 19:47:17 2014 +0600
https://developer.blender.org/rB30b5aef6789a2cf39020151b00410bd1d8f1c3d7

Fix T38427: Sculpt mode dimension changes don't Undo

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/sculpt_paint/sculpt_undo.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index c8645b1..eb40cb0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4376,7 +4376,7 @@ static void sculpt_restore_mesh(Sculpt *sd, Object *ob)
 }
 
 /* Copy the PBVH bounding box into the object's bounding box */
-static void sculpt_update_object_bounding_box(Object *ob)
+void sculpt_update_object_bounding_box(Object *ob)
 {
 	if (ob->bb) {
 		float bb_min[3], bb_max[3];
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index d904ec3..a692714 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -132,4 +132,6 @@ void sculpt_undo_push_end(void);
 
 void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]);
 
+void sculpt_update_object_bounding_box(struct Object *ob);
+
 #endif
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 6fa5c8f..03321cd 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -487,8 +487,12 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
 			tag_update |= 1;
 		}
 
-		if (tag_update)
+		if (tag_update) {
 			DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+		}
+		else {
+			sculpt_update_object_bounding_box(ob);
+		}
 
 		/* for non-PBVH drawing, need to recreate VBOs */
 		GPU_drawobject_free(ob->derivedFinal);




More information about the Bf-blender-cvs mailing list