From 619e6d440ad77688e1a2fd1d34605c430a715b0c Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Thu, 18 Jan 2024 17:53:21 -0800 Subject: [PATCH 1/5] Sculpt: Add global automasking propagation steps Updates necessary functions to ensure that brush-level settings are preferred over tool-level settings. Minor refactoring and comments applied to automasking code. Ref \#102377 --- scripts/startup/bl_ui/space_view3d.py | 2 +- .../blender/blenkernel/BKE_blender_version.h | 2 +- .../blenloader/intern/versioning_400.cc | 15 ++++++ .../blenloader/intern/versioning_defaults.cc | 6 +++ .../sculpt_paint/sculpt_automasking.cc | 54 ++++++++++--------- .../editors/sculpt_paint/sculpt_intern.hh | 12 ++++- source/blender/makesdna/DNA_brush_types.h | 6 ++- source/blender/makesdna/DNA_scene_defaults.h | 1 + source/blender/makesdna/DNA_scene_types.h | 5 +- source/blender/makesrna/intern/rna_brush.cc | 4 +- .../makesrna/intern/rna_sculpt_paint.cc | 11 ++++ 11 files changed, 87 insertions(+), 31 deletions(-) diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index 40ce95d0dd4..7b4c42de4df 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -8527,7 +8527,7 @@ class VIEW3D_PT_sculpt_automasking(Panel): col.prop(sculpt, "use_automasking_boundary_face_sets", text="Face Sets Boundary") if sculpt.use_automasking_boundary_edges or sculpt.use_automasking_boundary_face_sets: - col.prop(sculpt.brush, "automasking_boundary_edges_propagation_steps") + col.prop(sculpt, "automasking_boundary_edges_propagation_steps") col.separator() diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index f499f28a5a3..d30e8c891a1 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -29,7 +29,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 12 +#define BLENDER_FILE_SUBVERSION 13 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and cancel loading the file, showing a warning to diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index fbdf0b342a5..e7cc53258dc 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -2653,6 +2653,21 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) FOREACH_NODETREE_END; } + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 13)) { + if (!DNA_struct_member_exists( + fd->filesdna, "Sculpt", "int", "automasking_boundary_edges_propagation_steps")) + { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + Sculpt *sculpt = scene->toolsettings->sculpt; + if (sculpt != nullptr) { + Sculpt default_sculpt = *(DNA_struct_default_get(Sculpt)); + sculpt->automasking_boundary_edges_propagation_steps = + default_sculpt.automasking_boundary_edges_propagation_steps; + } + } + } + } + /** * Always bump subversion in BKE_blender_version.h when adding versioning * code here, and wrap it inside a MAIN_VERSION_FILE_ATLEAST check. diff --git a/source/blender/blenloader/intern/versioning_defaults.cc b/source/blender/blenloader/intern/versioning_defaults.cc index 29472974d6e..77e4d3d11af 100644 --- a/source/blender/blenloader/intern/versioning_defaults.cc +++ b/source/blender/blenloader/intern/versioning_defaults.cc @@ -383,6 +383,12 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene) if (idprop) { IDP_ClearProperty(idprop); } + + /* Ensure sculpt-mode global automasking_boundary_edges_propagation_steps is defaulted + * correctly.*/ + if (ts->sculpt) { + ts->sculpt->automasking_boundary_edges_propagation_steps = 1; + } } void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 450f4a877ed..ab27365e211 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -185,9 +185,19 @@ static bool sculpt_automasking_is_constrained_by_radius(const Brush *br) return false; } +/* Fetch the propogation_steps value, preferring the brush level value over the global sculpt tool + * * value. */ +static int SCULPT_automasking_boundary_propagation_steps(const Sculpt *sd, const Brush *brush) +{ + return brush && brush->automasking_flags & + (BRUSH_AUTOMASKING_BOUNDARY_EDGES | BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS) ? + brush->automasking_boundary_edges_propagation_steps : + sd->automasking_boundary_edges_propagation_steps; +} + +/* Determine if the given automasking settings require values to be precomputed and cached. */ static bool SCULPT_automasking_needs_factors_cache(const Sculpt *sd, const Brush *brush) { - const int automasking_flags = sculpt_automasking_mode_effective_bits(sd, brush); if (automasking_flags & BRUSH_AUTOMASKING_TOPOLOGY && brush && @@ -196,11 +206,17 @@ static bool SCULPT_automasking_needs_factors_cache(const Sculpt *sd, const Brush return true; } - if (automasking_flags & (BRUSH_AUTOMASKING_BOUNDARY_EDGES | - BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS | BRUSH_AUTOMASKING_VIEW_NORMAL)) - { + /* TODO: I'm unsure why the BRUSH_AUTOMASKING_VIEW_NORMAL cares at all about the propagation + * steps being non 1, should this only check for brush being non-nullptr? */ + if (automasking_flags & BRUSH_AUTOMASKING_VIEW_NORMAL) { return brush && brush->automasking_boundary_edges_propagation_steps != 1; } + + if (automasking_flags & + (BRUSH_AUTOMASKING_BOUNDARY_EDGES | BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS)) + { + return SCULPT_automasking_boundary_propagation_steps(sd, brush) != 1; + } return false; } @@ -802,10 +818,10 @@ bool tool_can_reuse_automask(int sculpt_tool) SCULPT_TOOL_DRAW_FACE_SETS); } +/* TODO: Update Sculpt * and Brush * to be const */ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob) { SculptSession *ss = ob->sculpt; - const int totvert = SCULPT_vertex_count_get(ss); if (!is_enabled(sd, ss, brush)) { return nullptr; @@ -817,14 +833,14 @@ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob) automasking->current_stroke_id = ss->stroke_id; - bool use_stroke_id = false; + /* Initialize and ensure variables on both SculptSession and the Cache. */ int mode = sculpt_automasking_mode_effective_bits(sd, brush); - if (mode & BRUSH_AUTOMASKING_TOPOLOGY && ss->active_vertex.i != PBVH_REF_NONE) { SCULPT_topology_islands_ensure(ob); automasking->settings.initial_island_nr = SCULPT_vertex_island_get(ss, ss->active_vertex); } + bool use_stroke_id = false; if ((mode & BRUSH_AUTOMASKING_VIEW_OCCLUSION) && (mode & BRUSH_AUTOMASKING_VIEW_NORMAL)) { use_stroke_id = true; @@ -881,6 +897,8 @@ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob) } } + /* If the current automasking modes do not require the cache to be precompued, + * avoid populating data on the vertex level. */ if (!SCULPT_automasking_needs_factors_cache(sd, brush)) { if (ss->attrs.automasking_factor) { BKE_sculpt_attribute_destroy(ob, ss->attrs.automasking_factor); @@ -898,29 +916,16 @@ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob) SCULPT_ATTRIBUTE_NAME(automasking_factor), ¶ms); - float initial_value; - - /* Topology, boundary and boundary face sets build up the mask - * from zero which other modes can subtract from. If none of them are - * enabled initialize to 1. - */ - if (!(mode & BRUSH_AUTOMASKING_TOPOLOGY)) { - initial_value = 1.0f; - } - else { - initial_value = 0.0f; - } - + /* Topology builds up the mask from zero which other modes can subtract from. + * If it isn't enabled, initialize to 1. */ + float initial_value = !(mode & BRUSH_AUTOMASKING_TOPOLOGY) ? 1.0f : 0.0f; + const int totvert = SCULPT_vertex_count_get(ss); for (int i : IndexRange(totvert)) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); (*(float *)SCULPT_vertex_attr_get(vertex, ss->attrs.automasking_factor)) = initial_value; } - const int boundary_propagation_steps = brush ? - brush->automasking_boundary_edges_propagation_steps : - 1; - /* Additive modes. */ if (mode_enabled(sd, brush, BRUSH_AUTOMASKING_TOPOLOGY)) { SCULPT_vertex_random_access_ensure(ss); @@ -935,6 +940,7 @@ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob) sculpt_face_sets_automasking_init(sd, ob); } + const int boundary_propagation_steps = SCULPT_automasking_boundary_propagation_steps(sd, brush); if (mode_enabled(sd, brush, BRUSH_AUTOMASKING_BOUNDARY_EDGES)) { SCULPT_vertex_random_access_ensure(ss); boundary_automasking_init(ob, AUTOMASK_INIT_BOUNDARY_EDGES, boundary_propagation_steps); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.hh b/source/blender/editors/sculpt_paint/sculpt_intern.hh index 23f6f789f15..99b5cadbe64 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.hh +++ b/source/blender/editors/sculpt_paint/sculpt_intern.hh @@ -1286,7 +1286,17 @@ float factor_get(Cache *automasking, * brushes and filter. */ Cache *active_cache_get(SculptSession *ss); -/* Brush can be null. */ +/** + * Creates and initializes an automasking cache. + * + * For automasking modes that cannot be calculated in real time, + * data is also stored at the vertex level prior to the stroke starting. + * + * \param sd: the sculpt tool + * \param brush: the brush being used (optional) + * \param ob: the object being operated on + * \return the automask cache + */ Cache *cache_init(Sculpt *sd, Brush *brush, Object *ob); void cache_free(Cache *automasking); diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 2ebb9e8fcf8..92e1f5a1e25 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -163,6 +163,8 @@ typedef struct BrushCurvesSculptSettings { struct CurveMapping *curve_parameter_falloff; } BrushCurvesSculptSettings; +/** Max number of propagation steps for automasking settings.*/ +#define AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS 20 typedef struct Brush { DNA_DEFINE_CXX_METHODS(Brush) @@ -313,7 +315,9 @@ typedef struct Brush { int deform_target; - /* automasking */ + /* Automasking mode flags + * See rna_brush.cc#rna_enum_brush_automasking_flag_items + */ int automasking_flags; int automasking_boundary_edges_propagation_steps; diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h index 1cc0a94b031..8fcf30aa25d 100644 --- a/source/blender/makesdna/DNA_scene_defaults.h +++ b/source/blender/makesdna/DNA_scene_defaults.h @@ -418,6 +418,7 @@ .automasking_start_normal_falloff = 0.25f, \ .automasking_view_normal_limit = 1.570796, /* 0.5 * pi. */ \ .automasking_view_normal_falloff = 0.25f, \ + .automasking_boundary_edges_propagation_steps = 1, \ .flags = SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE,\ .paint = {\ .symmetry_flags = PAINT_SYMMETRY_FEATHER,\ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 6f99a40d51a..db14f55ead8 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1087,6 +1087,9 @@ typedef struct Sculpt { /** Transform tool. */ int transform_mode; + /* Automasking mode flags + * See rna_brush.cc#rna_enum_brush_automasking_flag_items + */ int automasking_flags; // /* Control tablet input. */ @@ -1107,9 +1110,9 @@ typedef struct Sculpt { float constant_detail; float detail_percent; + int automasking_boundary_edges_propagation_steps; int automasking_cavity_blur_steps; float automasking_cavity_factor; - char _pad[4]; float automasking_start_normal_limit, automasking_start_normal_falloff; float automasking_view_normal_limit, automasking_view_normal_falloff; diff --git a/source/blender/makesrna/intern/rna_brush.cc b/source/blender/makesrna/intern/rna_brush.cc index 80441d34d2e..02d3060dac7 100644 --- a/source/blender/makesrna/intern/rna_brush.cc +++ b/source/blender/makesrna/intern/rna_brush.cc @@ -3183,8 +3183,8 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property( srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps"); - RNA_def_property_range(prop, 1, 20); - RNA_def_property_ui_range(prop, 1, 20, 1, 3); + RNA_def_property_range(prop, 1, AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS); + RNA_def_property_ui_range(prop, 1, AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS, 1, -1); RNA_def_property_ui_text(prop, "Propagation Steps", "Distance where boundary edge automasking is going to protect vertices " diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.cc b/source/blender/makesrna/intern/rna_sculpt_paint.cc index c802b445c09..0f2903e4057 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.cc +++ b/source/blender/makesrna/intern/rna_sculpt_paint.cc @@ -876,6 +876,17 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); } while ((++entry)->identifier); + prop = RNA_def_property( + srna, "automasking_boundary_edges_propagation_steps", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, nullptr, "automasking_boundary_edges_propagation_steps"); + RNA_def_property_range(prop, 1, AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS); + RNA_def_property_ui_range(prop, 1, AUTOMASKING_BOUNDARY_EDGES_MAX_PROPAGATION_STEPS, 1, -1); + RNA_def_property_ui_text(prop, + "Propagation Steps", + "Distance where boundary edge automasking is going to protect vertices " + "from the fully masked edge"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr); + prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, nullptr, "automasking_cavity_factor"); RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask"); -- 2.30.2 From db184fd490060d3c60c722246bb963d80c721ece Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Fri, 19 Jan 2024 15:20:20 -0800 Subject: [PATCH 2/5] Address CR comments --- .../blenloader/intern/versioning_defaults.cc | 2 -- .../sculpt_paint/sculpt_automasking.cc | 20 +++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_defaults.cc b/source/blender/blenloader/intern/versioning_defaults.cc index 77e4d3d11af..724284d8725 100644 --- a/source/blender/blenloader/intern/versioning_defaults.cc +++ b/source/blender/blenloader/intern/versioning_defaults.cc @@ -384,8 +384,6 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene) IDP_ClearProperty(idprop); } - /* Ensure sculpt-mode global automasking_boundary_edges_propagation_steps is defaulted - * correctly.*/ if (ts->sculpt) { ts->sculpt->automasking_boundary_edges_propagation_steps = 1; } diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 0d0820cb970..11b312570d8 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -204,8 +204,6 @@ static bool needs_factors_cache(const Sculpt *sd, const Brush *brush) return true; } - /* TODO: I'm unsure why the BRUSH_AUTOMASKING_VIEW_NORMAL cares at all about the propagation - * steps being non 1, should this only check for brush being non-nullptr? */ if (automasking_flags & BRUSH_AUTOMASKING_VIEW_NORMAL) { return brush && brush->automasking_boundary_edges_propagation_steps != 1; } @@ -807,6 +805,7 @@ bool tool_can_reuse_automask(int sculpt_tool) std::unique_ptr cache_init(Sculpt *sd, Brush *brush, Object *ob) { SculptSession *ss = ob->sculpt; + const int totvert = SCULPT_vertex_count_get(ss); if (!is_enabled(sd, ss, brush)) { return nullptr; @@ -899,10 +898,19 @@ std::unique_ptr cache_init(Sculpt *sd, Brush *brush, Object *ob) SCULPT_ATTRIBUTE_NAME(automasking_factor), ¶ms); - /* Topology builds up the mask from zero which other modes can subtract from. - * If it isn't enabled, initialize to 1. */ - float initial_value = !(mode & BRUSH_AUTOMASKING_TOPOLOGY) ? 1.0f : 0.0f; - const int totvert = SCULPT_vertex_count_get(ss); + float initial_value; + + /* Topology, boundary and boundary face sets build up the mask + * from zero which other modes can subtract from. If none of them are + * enabled initialize to 1. + */ + if (!(mode & BRUSH_AUTOMASKING_TOPOLOGY)) { + initial_value = 1.0f; + } + else { + initial_value = 0.0f; + } + for (int i : IndexRange(totvert)) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); -- 2.30.2 From bc0b22946db7b25c91e933ebedce0fdbe27044aa Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Fri, 19 Jan 2024 15:28:27 -0800 Subject: [PATCH 3/5] Bump subversion correctly --- source/blender/blenkernel/BKE_blender_version.h | 2 +- source/blender/blenloader/intern/versioning_400.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index d30e8c891a1..df3fc1a9a29 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -29,7 +29,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 13 +#define BLENDER_FILE_SUBVERSION 14 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and cancel loading the file, showing a warning to diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 0cc7bf93745..bfff8550aa3 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -2666,7 +2666,7 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) FOREACH_NODETREE_END; } - if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 13)) { + if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 14)) { if (!DNA_struct_member_exists( fd->filesdna, "Sculpt", "int", "automasking_boundary_edges_propagation_steps")) { -- 2.30.2 From 4aed7e3b00eec03c9493c343dd56c4652f339b10 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Fri, 19 Jan 2024 15:56:49 -0800 Subject: [PATCH 4/5] Remove exists check and unrelated changes --- .../blender/blenloader/intern/versioning_400.cc | 16 ++++++---------- .../editors/sculpt_paint/sculpt_intern.hh | 12 +----------- source/blender/makesdna/DNA_brush_types.h | 4 +--- source/blender/makesdna/DNA_scene_types.h | 3 --- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index bfff8550aa3..44cc0074fd7 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -2667,16 +2667,12 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain) } if (!MAIN_VERSION_FILE_ATLEAST(bmain, 401, 14)) { - if (!DNA_struct_member_exists( - fd->filesdna, "Sculpt", "int", "automasking_boundary_edges_propagation_steps")) - { - LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { - Sculpt *sculpt = scene->toolsettings->sculpt; - if (sculpt != nullptr) { - Sculpt default_sculpt = *(DNA_struct_default_get(Sculpt)); - sculpt->automasking_boundary_edges_propagation_steps = - default_sculpt.automasking_boundary_edges_propagation_steps; - } + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + Sculpt *sculpt = scene->toolsettings->sculpt; + if (sculpt != nullptr) { + Sculpt default_sculpt = *DNA_struct_default_get(Sculpt); + sculpt->automasking_boundary_edges_propagation_steps = + default_sculpt.automasking_boundary_edges_propagation_steps; } } } diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.hh b/source/blender/editors/sculpt_paint/sculpt_intern.hh index c240f0d784e..6445e907224 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.hh +++ b/source/blender/editors/sculpt_paint/sculpt_intern.hh @@ -1284,17 +1284,7 @@ float factor_get(Cache *automasking, * brushes and filter. */ Cache *active_cache_get(SculptSession *ss); -/** - * Creates and initializes an automasking cache. - * - * For automasking modes that cannot be calculated in real time, - * data is also stored at the vertex level prior to the stroke starting. - * - * \param sd: the sculpt tool - * \param brush: the brush being used (optional) - * \param ob: the object being operated on - * \return the automask cache - */ +/* Brush can be null. */ std::unique_ptr cache_init(Sculpt *sd, Brush *brush, Object *ob); void cache_free(Cache *automasking); diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 92e1f5a1e25..7f9d01edb29 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -315,9 +315,7 @@ typedef struct Brush { int deform_target; - /* Automasking mode flags - * See rna_brush.cc#rna_enum_brush_automasking_flag_items - */ + /* automasking */ int automasking_flags; int automasking_boundary_edges_propagation_steps; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index e91e66ad976..1ffbd20c725 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1087,9 +1087,6 @@ typedef struct Sculpt { /** Transform tool. */ int transform_mode; - /* Automasking mode flags - * See rna_brush.cc#rna_enum_brush_automasking_flag_items - */ int automasking_flags; // /* Control tablet input. */ -- 2.30.2 From df96aa98871c11f6b5fb0e509420a91eca2120d4 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Thu, 25 Jan 2024 12:38:40 -0800 Subject: [PATCH 5/5] Comment cleanup --- source/blender/editors/sculpt_paint/sculpt_automasking.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 4a73bef1748..49dd1afd0c5 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -186,7 +186,7 @@ static bool is_constrained_by_radius(const Brush *br) } /* Fetch the propogation_steps value, preferring the brush level value over the global sculpt tool - * * value. */ + * value. */ static int boundary_propagation_steps(const Sculpt *sd, const Brush *brush) { return brush && brush->automasking_flags & -- 2.30.2