[Bf-blender-cvs] [6d3da28676d] master: Sculpt: fix draw face sets not updating on first stroke
Joseph Eagar
noreply at git.blender.org
Thu Sep 29 10:47:45 CEST 2022
Commit: 6d3da28676d704c992e54d796071b872e0aced14
Author: Joseph Eagar
Date: Thu Sep 29 01:47:10 2022 -0700
Branches: master
https://developer.blender.org/rB6d3da28676d704c992e54d796071b872e0aced14
Sculpt: fix draw face sets not updating on first stroke
===================================================================
M source/blender/draw/intern/draw_pbvh.cc
M source/blender/editors/sculpt_paint/sculpt_face_set.cc
===================================================================
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. */
More information about the Bf-blender-cvs
mailing list