From 721ece9efb38e511e940bcfbb9c378d2e71067b8 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 18 Sep 2024 11:11:06 -0400 Subject: [PATCH] Cleanup: Sculpt: Move automasking functions to proper header --- .../brushes/bmesh_topology_rake.cc | 1 + .../editors/sculpt_paint/brushes/clay.cc | 1 + .../sculpt_paint/brushes/clay_strips.cc | 1 + .../sculpt_paint/brushes/clay_thumb.cc | 1 + .../editors/sculpt_paint/brushes/crease.cc | 1 + .../editors/sculpt_paint/brushes/draw.cc | 1 + .../sculpt_paint/brushes/draw_face_sets.cc | 1 + .../sculpt_paint/brushes/draw_sharp.cc | 1 + .../brushes/draw_vector_displacement.cc | 1 + .../sculpt_paint/brushes/elastic_deform.cc | 1 + .../sculpt_paint/brushes/enhance_details.cc | 1 + .../editors/sculpt_paint/brushes/fill.cc | 1 + .../editors/sculpt_paint/brushes/flatten.cc | 1 + .../editors/sculpt_paint/brushes/grab.cc | 1 + .../editors/sculpt_paint/brushes/inflate.cc | 1 + .../editors/sculpt_paint/brushes/layer.cc | 1 + .../editors/sculpt_paint/brushes/mask.cc | 1 + .../sculpt_paint/brushes/multiplane_scrape.cc | 1 + .../brushes/multires_displacement_eraser.cc | 1 + .../brushes/multires_displacement_smear.cc | 1 + .../editors/sculpt_paint/brushes/pinch.cc | 1 + .../editors/sculpt_paint/brushes/relax.cc | 1 + .../editors/sculpt_paint/brushes/rotate.cc | 1 + .../editors/sculpt_paint/brushes/scrape.cc | 1 + .../editors/sculpt_paint/brushes/smooth.cc | 1 + .../sculpt_paint/brushes/smooth_mask.cc | 1 + .../sculpt_paint/brushes/snake_hook.cc | 1 + .../sculpt_paint/brushes/surface_smooth.cc | 1 + .../editors/sculpt_paint/brushes/thumb.cc | 1 + .../sculpt_paint/brushes/topology_slide.cc | 1 + .../editors/sculpt_paint/mesh_brush_common.hh | 74 ------------------ .../editors/sculpt_paint/paint_hide.cc | 1 + .../editors/sculpt_paint/paint_mask.cc | 1 + .../editors/sculpt_paint/paint_weight.cc | 1 + source/blender/editors/sculpt_paint/sculpt.cc | 1 + .../editors/sculpt_paint/sculpt_automask.hh | 75 +++++++++++++++++++ .../sculpt_paint/sculpt_automasking.cc | 1 + .../editors/sculpt_paint/sculpt_boundary.cc | 1 + .../editors/sculpt_paint/sculpt_face_set.cc | 1 + .../sculpt_paint/sculpt_filter_mask.cc | 1 + .../sculpt_paint/sculpt_paint_color.cc | 1 + .../sculpt_paint/sculpt_paint_image.cc | 1 + .../editors/sculpt_paint/sculpt_pose.cc | 1 + .../editors/sculpt_paint/sculpt_project.cc | 1 + .../editors/sculpt_paint/sculpt_smooth.cc | 1 + .../editors/sculpt_paint/sculpt_transform.cc | 1 + .../editors/sculpt_paint/sculpt_undo.cc | 1 + 47 files changed, 120 insertions(+), 74 deletions(-) diff --git a/source/blender/editors/sculpt_paint/brushes/bmesh_topology_rake.cc b/source/blender/editors/sculpt_paint/brushes/bmesh_topology_rake.cc index 3f9563f6006..f64855f75a0 100644 --- a/source/blender/editors/sculpt_paint/brushes/bmesh_topology_rake.cc +++ b/source/blender/editors/sculpt_paint/brushes/bmesh_topology_rake.cc @@ -16,6 +16,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" #include "editors/sculpt_paint/sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/clay.cc b/source/blender/editors/sculpt_paint/brushes/clay.cc index 09c9b6899d6..d20b6ee9f13 100644 --- a/source/blender/editors/sculpt_paint/brushes/clay.cc +++ b/source/blender/editors/sculpt_paint/brushes/clay.cc @@ -18,6 +18,7 @@ #include "BLI_utildefines.h" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/clay_strips.cc b/source/blender/editors/sculpt_paint/brushes/clay_strips.cc index df97e7b7e9d..45c931692f2 100644 --- a/source/blender/editors/sculpt_paint/brushes/clay_strips.cc +++ b/source/blender/editors/sculpt_paint/brushes/clay_strips.cc @@ -25,6 +25,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/clay_thumb.cc b/source/blender/editors/sculpt_paint/brushes/clay_thumb.cc index db492232fcc..703b802705f 100644 --- a/source/blender/editors/sculpt_paint/brushes/clay_thumb.cc +++ b/source/blender/editors/sculpt_paint/brushes/clay_thumb.cc @@ -27,6 +27,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/crease.cc b/source/blender/editors/sculpt_paint/brushes/crease.cc index 48d547119ca..14ec88f8026 100644 --- a/source/blender/editors/sculpt_paint/brushes/crease.cc +++ b/source/blender/editors/sculpt_paint/brushes/crease.cc @@ -25,6 +25,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/draw.cc b/source/blender/editors/sculpt_paint/brushes/draw.cc index d0a2a046c46..92f24ced04c 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/draw_face_sets.cc b/source/blender/editors/sculpt_paint/brushes/draw_face_sets.cc index b6cc535d4b2..9f6b4ab1520 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw_face_sets.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw_face_sets.cc @@ -4,6 +4,7 @@ #include "editors/sculpt_paint/brushes/types.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "DNA_brush_types.h" diff --git a/source/blender/editors/sculpt_paint/brushes/draw_sharp.cc b/source/blender/editors/sculpt_paint/brushes/draw_sharp.cc index 9fa0f951e46..118e0678dcc 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw_sharp.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw_sharp.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc b/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc index 69c11744028..a457ff9638f 100644 --- a/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc +++ b/source/blender/editors/sculpt_paint/brushes/draw_vector_displacement.cc @@ -22,6 +22,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc b/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc index b9198d320fb..9ff0b1aeaf4 100644 --- a/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc +++ b/source/blender/editors/sculpt_paint/brushes/elastic_deform.cc @@ -24,6 +24,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/enhance_details.cc b/source/blender/editors/sculpt_paint/brushes/enhance_details.cc index 5a8451dde55..5b7b3d3bf68 100644 --- a/source/blender/editors/sculpt_paint/brushes/enhance_details.cc +++ b/source/blender/editors/sculpt_paint/brushes/enhance_details.cc @@ -19,6 +19,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" #include "editors/sculpt_paint/sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/fill.cc b/source/blender/editors/sculpt_paint/brushes/fill.cc index aa55831a0d5..5a0366d68bb 100644 --- a/source/blender/editors/sculpt_paint/brushes/fill.cc +++ b/source/blender/editors/sculpt_paint/brushes/fill.cc @@ -24,6 +24,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/flatten.cc b/source/blender/editors/sculpt_paint/brushes/flatten.cc index e24c25f1850..e984c53dc6e 100644 --- a/source/blender/editors/sculpt_paint/brushes/flatten.cc +++ b/source/blender/editors/sculpt_paint/brushes/flatten.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/grab.cc b/source/blender/editors/sculpt_paint/brushes/grab.cc index 939d05a5a90..513fc06aa1b 100644 --- a/source/blender/editors/sculpt_paint/brushes/grab.cc +++ b/source/blender/editors/sculpt_paint/brushes/grab.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/inflate.cc b/source/blender/editors/sculpt_paint/brushes/inflate.cc index afe78f30eea..92979956750 100644 --- a/source/blender/editors/sculpt_paint/brushes/inflate.cc +++ b/source/blender/editors/sculpt_paint/brushes/inflate.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/layer.cc b/source/blender/editors/sculpt_paint/brushes/layer.cc index 32602d485db..ea76997c9a9 100644 --- a/source/blender/editors/sculpt_paint/brushes/layer.cc +++ b/source/blender/editors/sculpt_paint/brushes/layer.cc @@ -25,6 +25,7 @@ #include "editors/sculpt_paint/mesh_brush_common.hh" #include "editors/sculpt_paint/paint_intern.hh" #include "editors/sculpt_paint/paint_mask.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/mask.cc b/source/blender/editors/sculpt_paint/brushes/mask.cc index af880d7ca3c..17defe80619 100644 --- a/source/blender/editors/sculpt_paint/brushes/mask.cc +++ b/source/blender/editors/sculpt_paint/brushes/mask.cc @@ -21,6 +21,7 @@ #include "editors/sculpt_paint/mesh_brush_common.hh" #include "editors/sculpt_paint/paint_intern.hh" #include "editors/sculpt_paint/paint_mask.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/multiplane_scrape.cc b/source/blender/editors/sculpt_paint/brushes/multiplane_scrape.cc index c2bef4c4660..3c0238a151b 100644 --- a/source/blender/editors/sculpt_paint/brushes/multiplane_scrape.cc +++ b/source/blender/editors/sculpt_paint/brushes/multiplane_scrape.cc @@ -31,6 +31,7 @@ #include #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/multires_displacement_eraser.cc b/source/blender/editors/sculpt_paint/brushes/multires_displacement_eraser.cc index 263ebc9302e..5887f2e1bad 100644 --- a/source/blender/editors/sculpt_paint/brushes/multires_displacement_eraser.cc +++ b/source/blender/editors/sculpt_paint/brushes/multires_displacement_eraser.cc @@ -20,6 +20,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/multires_displacement_smear.cc b/source/blender/editors/sculpt_paint/brushes/multires_displacement_smear.cc index 7bd3bb0c227..0182442100f 100644 --- a/source/blender/editors/sculpt_paint/brushes/multires_displacement_smear.cc +++ b/source/blender/editors/sculpt_paint/brushes/multires_displacement_smear.cc @@ -21,6 +21,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/pinch.cc b/source/blender/editors/sculpt_paint/brushes/pinch.cc index 2d5bd38f681..c6dacbcd0a4 100644 --- a/source/blender/editors/sculpt_paint/brushes/pinch.cc +++ b/source/blender/editors/sculpt_paint/brushes/pinch.cc @@ -24,6 +24,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/relax.cc b/source/blender/editors/sculpt_paint/brushes/relax.cc index 1771dc191a4..c362da494b3 100644 --- a/source/blender/editors/sculpt_paint/brushes/relax.cc +++ b/source/blender/editors/sculpt_paint/brushes/relax.cc @@ -14,6 +14,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_boundary.hh" #include "editors/sculpt_paint/sculpt_face_set.hh" #include "editors/sculpt_paint/sculpt_intern.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/rotate.cc b/source/blender/editors/sculpt_paint/brushes/rotate.cc index 9b052677891..165b967676a 100644 --- a/source/blender/editors/sculpt_paint/brushes/rotate.cc +++ b/source/blender/editors/sculpt_paint/brushes/rotate.cc @@ -24,6 +24,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/scrape.cc b/source/blender/editors/sculpt_paint/brushes/scrape.cc index 985d85e4e30..174a8bf4bc4 100644 --- a/source/blender/editors/sculpt_paint/brushes/scrape.cc +++ b/source/blender/editors/sculpt_paint/brushes/scrape.cc @@ -24,6 +24,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/smooth.cc b/source/blender/editors/sculpt_paint/brushes/smooth.cc index d5ea641ccef..c9737a8100e 100644 --- a/source/blender/editors/sculpt_paint/brushes/smooth.cc +++ b/source/blender/editors/sculpt_paint/brushes/smooth.cc @@ -21,6 +21,7 @@ #include "BLI_virtual_array.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_boundary.hh" #include "editors/sculpt_paint/sculpt_intern.hh" #include "editors/sculpt_paint/sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/smooth_mask.cc b/source/blender/editors/sculpt_paint/brushes/smooth_mask.cc index c8da6117088..57f6382bfc7 100644 --- a/source/blender/editors/sculpt_paint/brushes/smooth_mask.cc +++ b/source/blender/editors/sculpt_paint/brushes/smooth_mask.cc @@ -16,6 +16,7 @@ #include "editors/sculpt_paint/mesh_brush_common.hh" #include "editors/sculpt_paint/paint_intern.hh" #include "editors/sculpt_paint/paint_mask.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_boundary.hh" #include "editors/sculpt_paint/sculpt_intern.hh" #include "editors/sculpt_paint/sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/snake_hook.cc b/source/blender/editors/sculpt_paint/brushes/snake_hook.cc index 8c2f1f7966f..f70cf138000 100644 --- a/source/blender/editors/sculpt_paint/brushes/snake_hook.cc +++ b/source/blender/editors/sculpt_paint/brushes/snake_hook.cc @@ -27,6 +27,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/surface_smooth.cc b/source/blender/editors/sculpt_paint/brushes/surface_smooth.cc index 7dec5723141..ee9e6ea3f22 100644 --- a/source/blender/editors/sculpt_paint/brushes/surface_smooth.cc +++ b/source/blender/editors/sculpt_paint/brushes/surface_smooth.cc @@ -21,6 +21,7 @@ #include "BLI_virtual_array.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" #include "editors/sculpt_paint/sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/brushes/thumb.cc b/source/blender/editors/sculpt_paint/brushes/thumb.cc index 14fe118a738..ac424cde1db 100644 --- a/source/blender/editors/sculpt_paint/brushes/thumb.cc +++ b/source/blender/editors/sculpt_paint/brushes/thumb.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/brushes/topology_slide.cc b/source/blender/editors/sculpt_paint/brushes/topology_slide.cc index 694d8d67417..55706b2e114 100644 --- a/source/blender/editors/sculpt_paint/brushes/topology_slide.cc +++ b/source/blender/editors/sculpt_paint/brushes/topology_slide.cc @@ -23,6 +23,7 @@ #include "BLI_task.hh" #include "editors/sculpt_paint/mesh_brush_common.hh" +#include "editors/sculpt_paint/sculpt_automask.hh" #include "editors/sculpt_paint/sculpt_intern.hh" namespace blender::ed::sculpt_paint { diff --git a/source/blender/editors/sculpt_paint/mesh_brush_common.hh b/source/blender/editors/sculpt_paint/mesh_brush_common.hh index efec8887e95..d77b423ff40 100644 --- a/source/blender/editors/sculpt_paint/mesh_brush_common.hh +++ b/source/blender/editors/sculpt_paint/mesh_brush_common.hh @@ -280,80 +280,6 @@ void calc_brush_texture_factors(const SculptSession &ss, Span positions, MutableSpan factors); -namespace auto_mask { - -/** - * Calculate all auto-masking influence on each vertex. - */ -void calc_vert_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache &cache, - const bke::pbvh::MeshNode &node, - Span verts, - MutableSpan factors); -inline void calc_vert_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache *cache, - const bke::pbvh::MeshNode &node, - Span verts, - MutableSpan factors) -{ - if (cache == nullptr) { - return; - } - calc_vert_factors(depsgraph, object, *cache, node, verts, factors); -} -void calc_grids_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache &cache, - const bke::pbvh::GridsNode &node, - Span grids, - MutableSpan factors); -inline void calc_grids_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache *cache, - const bke::pbvh::GridsNode &node, - Span grids, - MutableSpan factors) -{ - if (cache == nullptr) { - return; - } - calc_grids_factors(depsgraph, object, *cache, node, grids, factors); -} -void calc_vert_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache &cache, - const bke::pbvh::BMeshNode &node, - const Set &verts, - MutableSpan factors); -inline void calc_vert_factors(const Depsgraph &depsgraph, - const Object &object, - const Cache *cache, - const bke::pbvh::BMeshNode &node, - const Set &verts, - MutableSpan factors) -{ - if (cache == nullptr) { - return; - } - calc_vert_factors(depsgraph, object, *cache, node, verts, factors); -} - -/** - * Calculate all auto-masking influence on each face. - */ -void calc_face_factors(const Depsgraph &depsgraph, - const Object &object, - OffsetIndices faces, - Span corner_verts, - const Cache &cache, - const bke::pbvh::MeshNode &node, - Span face_indices, - MutableSpan factors); - -} // namespace auto_mask - /** * Many brushes end up calculating translations from the original positions. Instead of applying * these directly to the modified values, it's helpful to process them separately to easily diff --git a/source/blender/editors/sculpt_paint/paint_hide.cc b/source/blender/editors/sculpt_paint/paint_hide.cc index 979e6c5c20d..a7ba6d6e2a7 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.cc +++ b/source/blender/editors/sculpt_paint/paint_hide.cc @@ -44,6 +44,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_gesture.hh" #include "sculpt_intern.hh" #include "sculpt_islands.hh" diff --git a/source/blender/editors/sculpt_paint/paint_mask.cc b/source/blender/editors/sculpt_paint/paint_mask.cc index aa977317ba1..631e7b8f767 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.cc +++ b/source/blender/editors/sculpt_paint/paint_mask.cc @@ -43,6 +43,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_gesture.hh" #include "sculpt_hide.hh" #include "sculpt_intern.hh" diff --git a/source/blender/editors/sculpt_paint/paint_weight.cc b/source/blender/editors/sculpt_paint/paint_weight.cc index bf1addaaf18..c6a4a328d15 100644 --- a/source/blender/editors/sculpt_paint/paint_weight.cc +++ b/source/blender/editors/sculpt_paint/paint_weight.cc @@ -69,6 +69,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" /* own include */ +#include "sculpt_automask.hh" #include "sculpt_intern.hh" using namespace blender; diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 55eb590a7ea..e5d09f1561f 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -100,6 +100,7 @@ #include "editors/sculpt_paint/brushes/types.hh" #include "mesh_brush_common.hh" +#include "sculpt_automask.hh" using blender::float3; using blender::MutableSpan; diff --git a/source/blender/editors/sculpt_paint/sculpt_automask.hh b/source/blender/editors/sculpt_paint/sculpt_automask.hh index 80d099b75ad..d0754b7b77d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automask.hh +++ b/source/blender/editors/sculpt_paint/sculpt_automask.hh @@ -11,16 +11,24 @@ #include "BLI_array.hh" #include "BLI_bit_vector.hh" +#include "BLI_offset_indices.hh" +#include "BLI_set.hh" #include "BLI_sys_types.h" #include "DNA_brush_enums.h" +struct BMVert; struct Brush; struct CurveMapping; struct Depsgraph; struct Object; struct Sculpt; struct SculptSession; +namespace blender::bke::pbvh { +struct MeshNode; +struct GridsNode; +struct BMeshNode; +} // namespace blender::bke::pbvh namespace blender::ed::sculpt_paint::auto_mask { @@ -96,4 +104,71 @@ bool needs_normal(const SculptSession &ss, const Sculpt &sd, const Brush *brush) bool brush_type_can_reuse_automask(int sculpt_brush_type); +/** + * Calculate all auto-masking influence on each vertex. + */ +void calc_vert_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache &cache, + const bke::pbvh::MeshNode &node, + Span verts, + MutableSpan factors); +inline void calc_vert_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache *cache, + const bke::pbvh::MeshNode &node, + Span verts, + MutableSpan factors) +{ + if (cache) { + calc_vert_factors(depsgraph, object, *cache, node, verts, factors); + } +} +void calc_grids_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache &cache, + const bke::pbvh::GridsNode &node, + Span grids, + MutableSpan factors); +inline void calc_grids_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache *cache, + const bke::pbvh::GridsNode &node, + Span grids, + MutableSpan factors) +{ + if (cache) { + calc_grids_factors(depsgraph, object, *cache, node, grids, factors); + } +} +void calc_vert_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache &cache, + const bke::pbvh::BMeshNode &node, + const Set &verts, + MutableSpan factors); +inline void calc_vert_factors(const Depsgraph &depsgraph, + const Object &object, + const Cache *cache, + const bke::pbvh::BMeshNode &node, + const Set &verts, + MutableSpan factors) +{ + if (cache) { + calc_vert_factors(depsgraph, object, *cache, node, verts, factors); + } +} + +/** + * Calculate all auto-masking influence on each face. + */ +void calc_face_factors(const Depsgraph &depsgraph, + const Object &object, + OffsetIndices faces, + Span corner_verts, + const Cache &cache, + const bke::pbvh::MeshNode &node, + Span face_indices, + MutableSpan factors); + } // namespace blender::ed::sculpt_paint::auto_mask diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 4c7492cb4c0..6c0756cf297 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -30,6 +30,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_boundary.hh" #include "sculpt_dyntopo.hh" #include "sculpt_face_set.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.cc b/source/blender/editors/sculpt_paint/sculpt_boundary.cc index 32adff4f7ca..7448655adca 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.cc +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.cc @@ -26,6 +26,7 @@ #include "brushes/types.hh" #include "mesh_brush_common.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_cloth.hh" #include "sculpt_flood_fill.hh" #include "sculpt_intern.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 926e1607673..f4e33b15828 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -54,6 +54,7 @@ #include "mesh_brush_common.hh" #include "paint_hide.hh" +#include "sculpt_automask.hh" #include "sculpt_boundary.hh" #include "sculpt_gesture.hh" #include "sculpt_intern.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc b/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc index acf8cda53df..6f84efa54fc 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc @@ -24,6 +24,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" #include "paint_mask.hh" +#include "sculpt_automask.hh" #include "sculpt_hide.hh" #include "sculpt_intern.hh" #include "sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc index 43a5f599299..c8df0d21a06 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc @@ -30,6 +30,7 @@ #include "IMB_colormanagement.hh" #include "mesh_brush_common.hh" +#include "sculpt_automask.hh" #include "sculpt_color.hh" #include "sculpt_intern.hh" #include "sculpt_smooth.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc index 96ff8eb56f6..c3ad1482b4e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc @@ -29,6 +29,7 @@ #include "bmesh.hh" #include "mesh_brush_common.hh" +#include "sculpt_automask.hh" #include "sculpt_intern.hh" namespace blender::ed::sculpt_paint::paint::image { diff --git a/source/blender/editors/sculpt_paint/sculpt_pose.cc b/source/blender/editors/sculpt_paint/sculpt_pose.cc index 28d0f07d773..498695b6c96 100644 --- a/source/blender/editors/sculpt_paint/sculpt_pose.cc +++ b/source/blender/editors/sculpt_paint/sculpt_pose.cc @@ -28,6 +28,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_cloth.hh" #include "sculpt_face_set.hh" #include "sculpt_flood_fill.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_project.cc b/source/blender/editors/sculpt_paint/sculpt_project.cc index 53a6a4ece0d..921cdf6d0c4 100644 --- a/source/blender/editors/sculpt_paint/sculpt_project.cc +++ b/source/blender/editors/sculpt_paint/sculpt_project.cc @@ -18,6 +18,7 @@ #include "WM_types.hh" #include "mesh_brush_common.hh" +#include "sculpt_automask.hh" #include "sculpt_gesture.hh" #include "sculpt_intern.hh" #include "sculpt_undo.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_smooth.cc b/source/blender/editors/sculpt_paint/sculpt_smooth.cc index 32ed3fdaa80..6daf680224d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_smooth.cc +++ b/source/blender/editors/sculpt_paint/sculpt_smooth.cc @@ -22,6 +22,7 @@ #include "BKE_subdiv_ccg.hh" #include "mesh_brush_common.hh" +#include "sculpt_automask.hh" #include "sculpt_color.hh" #include "sculpt_face_set.hh" #include "sculpt_hide.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.cc b/source/blender/editors/sculpt_paint/sculpt_transform.cc index 24ecbeb5663..fff3c9d95f3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.cc +++ b/source/blender/editors/sculpt_paint/sculpt_transform.cc @@ -36,6 +36,7 @@ #include "mesh_brush_common.hh" #include "paint_intern.hh" #include "paint_mask.hh" +#include "sculpt_automask.hh" #include "sculpt_filter.hh" #include "sculpt_intern.hh" #include "sculpt_undo.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.cc b/source/blender/editors/sculpt_paint/sculpt_undo.cc index 8fb64ed876c..5f6f7245836 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.cc +++ b/source/blender/editors/sculpt_paint/sculpt_undo.cc @@ -82,6 +82,7 @@ #include "mesh_brush_common.hh" #include "paint_hide.hh" #include "paint_intern.hh" +#include "sculpt_automask.hh" #include "sculpt_color.hh" #include "sculpt_dyntopo.hh" #include "sculpt_face_set.hh"