diff options
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index c8645b1f3de..eb40cb00b41 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 d904ec3bc96..a69271463cf 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 6fa5c8fbf5a..03321cd1a85 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); |