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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-31 13:51:12 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-31 18:17:03 +0300
commitf87bba0368ea3d0b71559cfae662ae9e3b39ad6f (patch)
treea51b9512487f41593e905f91123bba1d0147e35e /source/blender/editors/sculpt_paint
parent151f69a5c214691de0665affcd8a49cecd6dd0aa (diff)
Fix T62282: multires sculpting does not update smooth normals
It may be good to move the normals update out of the drawing code. But it was already there for the non-multires sculpt cases, and does not have an obvious place since we bypass the depsgraph and want to avoid the cost of updating the normals multiple times when multiple events are handled before a redraw.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c3
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c4
3 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index bdb8ccb09a4..439c237cd57 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1497,8 +1497,7 @@ static void vwpaint_update_cache_variants(bContext *C, VPaint *vp, Object *ob, P
cache->radius_squared = cache->radius * cache->radius;
if (ss->pbvh) {
- BKE_pbvh_update(ss->pbvh, PBVH_UpdateRedraw, NULL);
- BKE_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
+ BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateRedraw | PBVH_UpdateBB);
}
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 2855e3181c0..4e5c2a74023 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -506,7 +506,7 @@ void ED_sculpt_redraw_planes_get(float planes[4][4], ARegion *ar, Object *ob)
/* clear redraw flag from nodes */
if (pbvh) {
- BKE_pbvh_update(pbvh, PBVH_UpdateRedraw, NULL);
+ BKE_pbvh_update_bounds(pbvh, PBVH_UpdateRedraw);
}
}
@@ -5208,7 +5208,7 @@ static void sculpt_flush_update_step(bContext *C)
* only the part of the 3D viewport where changes happened. */
rcti r;
- BKE_pbvh_update(ss->pbvh, PBVH_UpdateBB, NULL);
+ BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB);
/* Update the object's bounding box too so that the object
* doesn't get incorrectly clipped during drawing in
* draw_mesh_object(). [#33790] */
@@ -5255,7 +5255,7 @@ static void sculpt_flush_update_done(const bContext *C, Object *ob)
}
}
- BKE_pbvh_update(ss->pbvh, PBVH_UpdateOriginalBB, NULL);
+ BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateOriginalBB);
if (BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) {
BKE_pbvh_bmesh_after_stroke(ss->pbvh);
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 3c26a0e2541..75a2af4526f 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -549,9 +549,7 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
else {
BKE_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, &rebuild);
}
- BKE_pbvh_update(ss->pbvh,
- PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw | PBVH_UpdateNormals,
- NULL);
+ BKE_pbvh_update_bounds(ss->pbvh, PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateRedraw);
if (BKE_sculpt_multires_active(scene, ob)) {
if (rebuild) {