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:
authorJoseph Eagar <joeedh@gmail.com>2022-09-29 11:47:10 +0300
committerJeroen Bakker <jeroen@blender.org>2022-10-03 15:59:17 +0300
commit31317ea4f991c28571aa11e4d24979e481526698 (patch)
treeb4640667abf4ee887d86ca0fdf2a014a75e03782
parent363fe35360937b390e5b99c382bae5e5b3509e62 (diff)
Sculpt: fix draw face sets not updating on first stroke
-rw-r--r--source/blender/draw/intern/draw_pbvh.cc4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_face_set.cc6
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_pbvh.cc b/source/blender/draw/intern/draw_pbvh.cc
index 2f325f7cf62..895abdfc2ac 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -558,10 +558,10 @@ struct PBVHBatches {
foreach_faces(
[&](int /*buffer_i*/, int /*tri_i*/, int /*vertex_i*/, const MLoopTri *tri) {
- if (last_poly != tri->poly && args->face_sets) {
+ if (last_poly != tri->poly) {
last_poly = tri->poly;
- const int fset = abs(face_sets[tri->poly]);
+ const int fset = face_sets[tri->poly];
if (fset != args->face_sets_color_default) {
BKE_paint_face_set_overlay_color_get(
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc
index 1327f40f95a..962ecf42691 100644
--- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc
@@ -248,6 +248,12 @@ void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, in
SculptSession *ss = ob->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
+ if (ss->pbvh) {
+ Mesh *mesh = BKE_mesh_from_object(ob);
+ BKE_pbvh_face_sets_color_set(
+ ss->pbvh, mesh->face_sets_color_seed, mesh->face_sets_color_default);
+ }
+
BKE_curvemapping_init(brush->curve);
/* Threaded loop over nodes. */