[Bf-blender-cvs] [5e2b2348559] sculpt-dev: sculpt-dev: fix draw face sets brush
Joseph Eagar
noreply at git.blender.org
Thu Oct 6 11:18:35 CEST 2022
Commit: 5e2b2348559989866ac30c4f1f207cb784f0b8f3
Author: Joseph Eagar
Date: Thu Oct 6 02:18:21 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rB5e2b2348559989866ac30c4f1f207cb784f0b8f3
sculpt-dev: fix draw face sets brush
===================================================================
M source/blender/draw/intern/draw_pbvh.cc
M source/blender/editors/sculpt_paint/sculpt_automasking.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 9e4779eca81..cc0b6a3c005 100644
--- a/source/blender/draw/intern/draw_pbvh.cc
+++ b/source/blender/draw/intern/draw_pbvh.cc
@@ -975,7 +975,13 @@ struct PBVHBatches {
uchar face_set_color[4];
int fset = BM_ELEM_CD_GET_INT(l->f, cd_fset);
- BKE_paint_face_set_overlay_color_get(fset, args->face_sets_color_seed, face_set_color);
+ if (fset != args->face_sets_color_default) {
+ BKE_paint_face_set_overlay_color_get(
+ fset, args->face_sets_color_seed, face_set_color);
+ }
+ else {
+ face_set_color[0] = face_set_color[1] = face_set_color[2] = 255;
+ }
*static_cast<uchar3 *>(GPU_vertbuf_raw_step(&access)) = face_set_color;
});
diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index 41767d4857a..cd8d9823527 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -83,9 +83,6 @@ bool SCULPT_is_automasking_mode_enabled(const Sculpt *sd,
bool SCULPT_is_automasking_enabled(const Sculpt *sd, const SculptSession *ss, const Brush *br)
{
- if (br && SCULPT_stroke_is_dynamic_topology(ss, br)) {
- return false;
- }
if (SCULPT_is_automasking_mode_enabled(sd, br, BRUSH_AUTOMASKING_TOPOLOGY)) {
return true;
}
@@ -746,7 +743,6 @@ void SCULPT_automasking_cache_settings_update(AutomaskingCache *automasking,
const Brush *brush)
{
automasking->settings.flags = sculpt_automasking_mode_effective_bits(sd, brush);
- automasking->settings.initial_face_set = SCULPT_active_face_set_get(ss);
automasking->settings.view_normal_limit = sd->automasking_view_normal_limit;
automasking->settings.view_normal_falloff = sd->automasking_view_normal_falloff;
@@ -820,6 +816,10 @@ AutomaskingCache *SCULPT_automasking_cache_init(Sculpt *sd, const Brush *brush,
AutomaskingCache *automasking = (AutomaskingCache *)MEM_callocN(sizeof(AutomaskingCache),
"automasking cache");
+
+ automasking->settings.initial_face_set = SCULPT_active_face_set_get(ss);
+ automasking->settings.current_face_set = automasking->settings.initial_face_set;
+
SCULPT_automasking_cache_settings_update(automasking, ss, sd, brush);
SCULPT_boundary_info_ensure(ob);
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc
index daf0d3e66b1..8b4c298dadd 100644
--- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc
@@ -306,9 +306,9 @@ static int new_fset_apply_curve(SculptSession *ss,
return new_fset;
}
-void do_draw_face_sets_brush_task_cb_ex(void *__restrict userdata,
- const int n,
- const TaskParallelTLS *__restrict tls)
+ATTR_NO_OPT void do_draw_face_sets_brush_task_cb_ex(void *__restrict userdata,
+ const int n,
+ const TaskParallelTLS *__restrict tls)
{
SculptFaceSetDrawData *data = (SculptFaceSetDrawData *)userdata;
SculptSession *ss = data->ob->sculpt;
@@ -340,7 +340,7 @@ void do_draw_face_sets_brush_task_cb_ex(void *__restrict userdata,
/*check if we need to sample the current face set*/
bool set_active_faceset = ss->cache->automasking &&
- (brush->automasking_flags & BRUSH_AUTOMASKING_FACE_SETS);
+ (ss->cache->automasking->settings.flags & BRUSH_AUTOMASKING_FACE_SETS);
set_active_faceset = set_active_faceset && ss->cache->invert;
set_active_faceset = set_active_faceset && ss->cache->automasking->settings.initial_face_set ==
ss->cache->automasking->settings.current_face_set;
@@ -661,7 +661,7 @@ static void do_relax_face_sets_brush_task_cb_ex(void *__restrict userdata,
BKE_pbvh_vertex_iter_end;
}
-void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
+ATTR_NO_OPT void SCULPT_do_draw_face_sets_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
{
SculptSession *ss = ob->sculpt;
Brush *brush = ss->cache->brush ? ss->cache->brush : BKE_paint_brush(&sd->paint);
More information about the Bf-blender-cvs
mailing list