Blender V5.3
blender::ed::sculpt_paint::mask Namespace Reference

Classes

struct  FilterLocalData
struct  LocalData
struct  MaskOperation

Enumerations

enum class  FilterType {
  Smooth = 0 , Sharpen = 1 , Grow = 2 , Shrink = 3 ,
  ContrastIncrease = 5 , ContrastDecrease = 6
}
enum class  InitMode { Random , FaceSet , Island }

Functions

void write_mask_mesh (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> write_fn)
static BLI_NOINLINE void copy_old_hidden_mask_mesh (const Span< int > verts, const Span< bool > hide_vert, const Span< float > mask, const MutableSpan< float > new_mask)
static BLI_NOINLINE void multiply_add (const Span< float > src, const float factor, const float offset, const MutableSpan< float > dst)
static BLI_NOINLINE void mask_increase_contrast (const Span< float > src, const MutableSpan< float > dst)
static BLI_NOINLINE void mask_decrease_contrast (const Span< float > src, const MutableSpan< float > dst)
static BLI_NOINLINE void sharpen_masks (const Span< float > old_masks, const MutableSpan< float > new_mask)
static void apply_new_mask_mesh (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const OffsetIndices< int > node_verts, const Span< float > new_mask, MutableSpan< float > mask)
static void smooth_mask_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const Span< bool > hide_vert, const Span< float > mask, const bke::pbvh::MeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void sharpen_mask_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const Span< bool > hide_vert, const Span< float > mask, const bke::pbvh::MeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void grow_mask_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const Span< bool > hide_vert, const Span< float > mask, const bke::pbvh::MeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void shrink_mask_mesh (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const Span< bool > hide_vert, const Span< float > mask, const bke::pbvh::MeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static bool increase_contrast_mask_mesh (const Depsgraph &depsgraph, const Object &object, const Span< bool > hide_vert, bke::pbvh::MeshNode &node, MutableSpan< float > mask)
static bool decrease_contrast_mask_mesh (const Depsgraph &depsgraph, const Object &object, const Span< bool > hide_vert, bke::pbvh::MeshNode &node, MutableSpan< float > mask)
static BLI_NOINLINE void copy_old_hidden_mask_grids (const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< float > new_mask)
static void apply_new_mask_grids (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const OffsetIndices< int > node_verts, const Span< float > new_mask)
static void smooth_mask_grids (const SubdivCCG &subdiv_ccg, const bke::pbvh::GridsNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void sharpen_mask_grids (const SubdivCCG &subdiv_ccg, const bke::pbvh::GridsNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void grow_mask_grids (const SubdivCCG &subdiv_ccg, const bke::pbvh::GridsNode &node, MutableSpan< float > new_mask)
static void shrink_mask_grids (const SubdivCCG &subdiv_ccg, const bke::pbvh::GridsNode &node, MutableSpan< float > new_mask)
static bool increase_contrast_mask_grids (const Depsgraph &depsgraph, const Object &object, bke::pbvh::GridsNode &node, FilterLocalData &tls)
static bool decrease_contrast_mask_grids (const Depsgraph &depsgraph, const Object &object, bke::pbvh::GridsNode &node, FilterLocalData &tls)
static BLI_NOINLINE void copy_old_hidden_mask_bmesh (const int mask_offset, const Set< BMVert *, 0 > &verts, const MutableSpan< float > new_mask)
static void apply_new_mask_bmesh (const Depsgraph &depsgraph, Object &object, const int mask_offset, const IndexMask &node_mask, const OffsetIndices< int > node_verts, const Span< float > new_mask)
static void smooth_mask_bmesh (const BMesh &bm, const int mask_offset, bke::pbvh::BMeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void sharpen_mask_bmesh (const BMesh &bm, const int mask_offset, bke::pbvh::BMeshNode &node, FilterLocalData &tls, MutableSpan< float > new_mask)
static void grow_mask_bmesh (const int mask_offset, bke::pbvh::BMeshNode &node, MutableSpan< float > new_mask)
static void shrink_mask_bmesh (const int mask_offset, bke::pbvh::BMeshNode &node, MutableSpan< float > new_mask)
static bool increase_contrast_mask_bmesh (const Depsgraph &depsgraph, Object &object, const int mask_offset, bke::pbvh::BMeshNode &node, FilterLocalData &tls)
static bool decrease_contrast_mask_bmesh (const Depsgraph &depsgraph, Object &object, const int mask_offset, bke::pbvh::BMeshNode &node, FilterLocalData &tls)
static wmOperatorStatus sculpt_mask_filter_exec (bContext *C, wmOperator *op)
void SCULPT_OT_mask_filter (wmOperatorType *ot)
void SCULPT_OT_mask_init (wmOperatorType *ot)
static void init_mask_grids (Main &bmain, Scene &scene, Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(const BitGroupVector<> &, int, MutableSpan< float >)> write_fn)
static wmOperatorStatus sculpt_mask_init_exec (bContext *C, wmOperator *op)
Public API
Array< float > duplicate_mask (const Object &object)
void mix_new_masks (const Span< float > new_masks, const float factor, const MutableSpan< float > masks)
void mix_new_masks (const Span< float > new_masks, const Span< float > factors, const MutableSpan< float > masks)
void clamp_mask (const MutableSpan< float > masks)
void invert_mask (const MutableSpan< float > masks)
void gather_mask_bmesh (const BMesh &bm, const Set< BMVert *, 0 > &verts, const MutableSpan< float > r_mask)
void gather_mask_grids (const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< float > r_mask)
void scatter_mask_grids (const Span< float > mask, SubdivCCG &subdiv_ccg, const Span< int > grids)
void scatter_mask_bmesh (const Span< float > mask, const BMesh &bm, const Set< BMVert *, 0 > &verts)
static float average_masks (const int mask_offset, const Span< const BMVert * > verts)
void average_neighbor_mask_bmesh (const int mask_offset, const Set< BMVert *, 0 > &verts, const MutableSpan< float > new_masks)
void update_mask_mesh (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> update_fn)
bool mask_equals_array_grids (const Span< float > masks, const CCGKey &key, const Span< int > grids, const Span< float > values)
bool mask_equals_array_bmesh (const int mask_offset, const Set< BMVert *, 0 > &verts, const Span< float > values)
Gesture-based Mask Operators

Operators that act upon a user-selected area.

static void gesture_begin (bContext &C, wmOperator &op, gesture::GestureData &gesture_data)
static float mask_gesture_get_new_value (const float elem, FloodFillMode mode, float value)
static void gesture_apply_for_symmetry_pass (bContext &, gesture::GestureData &gesture_data)
static void gesture_end (bContext &C, gesture::GestureData &gesture_data)
static void init_operation (bContext &C, gesture::GestureData &gesture_data, wmOperator &op)
static void gesture_operator_properties (wmOperatorType *ot)
static wmOperatorStatus gesture_box_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_lasso_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_line_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_polyline_exec (bContext *C, wmOperator *op)
void PAINT_OT_mask_lasso_gesture (wmOperatorType *ot)
void PAINT_OT_mask_box_gesture (wmOperatorType *ot)
void PAINT_OT_mask_line_gesture (wmOperatorType *ot)
void PAINT_OT_mask_polyline_gesture (wmOperatorType *ot)
Mask By Color
static float color_delta_get (const float3 &color_a, const float3 &color_b, const float threshold, const bool invert)
static float final_mask_get (const float current_mask, const float new_mask, const bool invert, const bool preserve_mask)
static void mask_by_color_contiguous_mesh (const Depsgraph &depsgraph, Object &object, const int vert, const float threshold, const bool invert, const bool preserve_mask)
static void mask_by_color_full_mesh (const Depsgraph &depsgraph, Object &object, const int vert, const float threshold, const bool invert, const bool preserve_mask)
static wmOperatorStatus mask_by_color (bContext *C, wmOperator *op, const float2 region_location)
static wmOperatorStatus mask_by_color_exec (bContext *C, wmOperator *op)
static wmOperatorStatus mask_by_color_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void SCULPT_OT_mask_by_color (wmOperatorType *ot)

Global Mask Operators

Operators that act upon the entirety of a given object's mesh.

enum class  FloodFillMode { Value = SEL_OP_SUB , InverseValue = SEL_OP_ADD , InverseMeshValue = SEL_OP_XOR }
static const EnumPropertyItem mode_items []
static Span< int > get_hidden_verts (const bke::pbvh::MeshNode &node, const Span< bool > hide_vert, Vector< int > &indices)
static bool try_remove_mask_mesh (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void fill_mask_mesh (const Depsgraph &depsgraph, Object &object, const float value, const IndexMask &node_mask)
static void fill_mask_grids (Main &bmain, const Scene &scene, Depsgraph &depsgraph, Object &object, const float value, const IndexMask &node_mask)
static void fill_mask_bmesh (const Depsgraph &depsgraph, Object &object, const float value, const IndexMask &node_mask)
static void fill_mask (Main &bmain, const Scene &scene, Depsgraph &depsgraph, Object &object, const float value)
static void invert_mask_grids (Main &bmain, const Scene &scene, Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void invert_mask_bmesh (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void invert_mask (Main &bmain, const Scene &scene, Depsgraph &depsgraph, Object &object)
static wmOperatorStatus mask_flood_fill_exec (bContext *C, wmOperator *op)
void PAINT_OT_mask_flood_fill (wmOperatorType *ot)

Mask from Cavity

enum class  ApplyMaskMode : int8_t {
  Mix , Multiply , Divide , Add ,
  Subtract
}
enum class  MaskSettingsSource : int8_t { Operator , Scene , Brush }
enum class  MaskBoundaryMode : int8_t { Mesh , FaceSets }
static EnumPropertyItem mix_modes []
static EnumPropertyItem settings_sources []
static void calc_new_masks (const ApplyMaskMode mode, const Span< float > node_mask, const MutableSpan< float > new_mask)
static void apply_mask_mesh (const Depsgraph &depsgraph, const Object &object, const Span< bool > hide_vert, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const bke::pbvh::MeshNode &node, LocalData &tls, const MutableSpan< float > mask)
static void apply_mask_grids (const Depsgraph &depsgraph, Object &object, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const bke::pbvh::GridsNode &node, LocalData &tls)
static void apply_mask_bmesh (const Depsgraph &depsgraph, Object &object, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, bke::pbvh::BMeshNode &node, LocalData &tls)
static void apply_mask_from_settings (const Depsgraph &depsgraph, Object &object, bke::pbvh::Tree &pbvh, const IndexMask &node_mask, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor)
static wmOperatorStatus mask_from_cavity_exec (bContext *C, wmOperator *op)
static void mask_from_cavity_ui (bContext *C, wmOperator *op)
static void SCULPT_OT_mask_from_cavity (wmOperatorType *ot)
static wmOperatorStatus mask_from_boundary_exec (bContext *C, wmOperator *op)
static void mask_from_boundary_ui (bContext *C, wmOperator *op)
static void SCULPT_OT_mask_from_boundary (wmOperatorType *ot)

Enumeration Type Documentation

◆ ApplyMaskMode

Enumerator
Mix 
Multiply 
Divide 
Add 
Subtract 

Definition at line 776 of file mesh/sculpt_ops.cc.

◆ FilterType

Enumerator
Smooth 
Sharpen 
Grow 
Shrink 
ContrastIncrease 
ContrastDecrease 

Definition at line 40 of file sculpt_filter_mask.cc.

◆ FloodFillMode

Enumerator
Value 
InverseValue 
InverseMeshValue 

Definition at line 317 of file paint_mask.cc.

◆ InitMode

Enumerator
Random 
FaceSet 
Island 

Definition at line 43 of file sculpt_mask_init.cc.

◆ MaskBoundaryMode

Enumerator
Mesh 
FaceSets 

Definition at line 1227 of file mesh/sculpt_ops.cc.

◆ MaskSettingsSource

Enumerator
Operator 
Scene 
Brush 

Definition at line 793 of file mesh/sculpt_ops.cc.

Function Documentation

◆ apply_mask_bmesh()

◆ apply_mask_from_settings()

◆ apply_mask_grids()

◆ apply_mask_mesh()

◆ apply_new_mask_bmesh()

◆ apply_new_mask_grids()

◆ apply_new_mask_mesh()

◆ average_masks()

float blender::ed::sculpt_paint::mask::average_masks ( const int mask_offset,
const Span< const BMVert * > verts )
static

◆ average_neighbor_mask_bmesh()

void blender::ed::sculpt_paint::mask::average_neighbor_mask_bmesh ( const int mask_offset,
const Set< BMVert *, 0 > & verts,
const MutableSpan< float > new_masks )

◆ calc_new_masks()

void blender::ed::sculpt_paint::mask::calc_new_masks ( const ApplyMaskMode mode,
const Span< float > node_mask,
const MutableSpan< float > new_mask )
static

◆ clamp_mask()

◆ color_delta_get()

float blender::ed::sculpt_paint::mask::color_delta_get ( const float3 & color_a,
const float3 & color_b,
const float threshold,
const bool invert )
static

◆ copy_old_hidden_mask_bmesh()

BLI_NOINLINE void blender::ed::sculpt_paint::mask::copy_old_hidden_mask_bmesh ( const int mask_offset,
const Set< BMVert *, 0 > & verts,
const MutableSpan< float > new_mask )
static

◆ copy_old_hidden_mask_grids()

◆ copy_old_hidden_mask_mesh()

◆ decrease_contrast_mask_bmesh()

◆ decrease_contrast_mask_grids()

◆ decrease_contrast_mask_mesh()

◆ duplicate_mask()

◆ fill_mask()

void blender::ed::sculpt_paint::mask::fill_mask ( Main & bmain,
const Scene & scene,
Depsgraph & depsgraph,
Object & object,
const float value )
static

◆ fill_mask_bmesh()

◆ fill_mask_grids()

◆ fill_mask_mesh()

◆ final_mask_get()

float blender::ed::sculpt_paint::mask::final_mask_get ( const float current_mask,
const float new_mask,
const bool invert,
const bool preserve_mask )
static

◆ gather_mask_bmesh()

◆ gather_mask_grids()

◆ gesture_apply_for_symmetry_pass()

void blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass ( bContext & ,
gesture::GestureData & gesture_data )
static

Definition at line 802 of file paint_mask.cc.

References blender::BKE_pbvh_bmesh_node_unique_verts(), blender::BKE_subdiv_ccg_foreach_visible_grid_vert(), blender::BKE_subdiv_ccg_key_top_level(), blender::bm, blender::SculptSession::bm, BM_ELEM_CD_GET_FLOAT, BM_ELEM_CD_SET_FLOAT, blender::bke::pbvh::BMesh, blender::CD_PROP_FLOAT, blender::CustomData_get_offset_named(), blender::ViewContext::depsgraph, blender::ED_view3d_clipping_local(), blender::ED_view3d_clipping_test(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bools(), gesture_apply_for_symmetry_pass(), blender::exec_mode::grain_size(), blender::CCGKey::grid_area, blender::bke::pbvh::Grids, blender::Span< T >::index_range(), blender::ed::sculpt_paint::gesture::is_affected(), blender::ed::sculpt_paint::undo::Mask, mask_gesture_get_new_value(), blender::bke::pbvh::Mesh, blender::index_mask::IndexMask::min_array_size(), blender::ed::sculpt_paint::mask::MaskOperation::mode, node, blender::ed::sculpt_paint::gesture::GestureData::node_mask, blender::bke::pbvh::node_update_mask_bmesh(), blender::bke::pbvh::node_update_mask_grids(), blender::ViewContext::obact, blender::ed::sculpt_paint::gesture::GestureData::operation, blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::undo::push_node(), blender::ViewContext::rv3d, RV3D_CLIPPING_ENABLED, blender::ed::sculpt_paint::gesture::GestureData::ss, blender::SculptSession::subdiv_ccg, update_mask_mesh(), blender::ViewContext::v3d, blender::ed::sculpt_paint::mask::MaskOperation::value, blender::ed::sculpt_paint::gesture::GestureData::vc, blender::BMesh::vdata, blender::bke::pbvh::vert_normals_eval(), and blender::bke::pbvh::vert_positions_eval().

Referenced by gesture_apply_for_symmetry_pass(), and init_operation().

◆ gesture_begin()

◆ gesture_box_exec()

◆ gesture_end()

◆ gesture_lasso_exec()

◆ gesture_line_exec()

◆ gesture_operator_properties()

◆ gesture_polyline_exec()

◆ get_hidden_verts()

◆ grow_mask_bmesh()

void blender::ed::sculpt_paint::mask::grow_mask_bmesh ( const int mask_offset,
bke::pbvh::BMeshNode & node,
MutableSpan< float > new_mask )
static

◆ grow_mask_grids()

◆ grow_mask_mesh()

void blender::ed::sculpt_paint::mask::grow_mask_mesh ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > vert_to_face,
const Span< bool > hide_poly,
const Span< bool > hide_vert,
const Span< float > mask,
const bke::pbvh::MeshNode & node,
FilterLocalData & tls,
MutableSpan< float > new_mask )
static

◆ increase_contrast_mask_bmesh()

◆ increase_contrast_mask_grids()

◆ increase_contrast_mask_mesh()

◆ init_mask_grids()

◆ init_operation()

◆ invert_mask() [1/2]

void blender::ed::sculpt_paint::mask::invert_mask ( const MutableSpan< float > masks)

◆ invert_mask() [2/2]

void blender::ed::sculpt_paint::mask::invert_mask ( Main & bmain,
const Scene & scene,
Depsgraph & depsgraph,
Object & object )
static

◆ invert_mask_bmesh()

◆ invert_mask_grids()

◆ mask_by_color()

◆ mask_by_color_contiguous_mesh()

◆ mask_by_color_exec()

wmOperatorStatus blender::ed::sculpt_paint::mask::mask_by_color_exec ( bContext * C,
wmOperator * op )
static

◆ mask_by_color_full_mesh()

void blender::ed::sculpt_paint::mask::mask_by_color_full_mesh ( const Depsgraph & depsgraph,
Object & object,
const int vert,
const float threshold,
const bool invert,
const bool preserve_mask )
static

◆ mask_by_color_invoke()

wmOperatorStatus blender::ed::sculpt_paint::mask::mask_by_color_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ mask_decrease_contrast()

BLI_NOINLINE void blender::ed::sculpt_paint::mask::mask_decrease_contrast ( const Span< float > src,
const MutableSpan< float > dst )
static

◆ mask_equals_array_bmesh()

bool blender::ed::sculpt_paint::mask::mask_equals_array_bmesh ( const int mask_offset,
const Set< BMVert *, 0 > & verts,
const Span< float > values )

◆ mask_equals_array_grids()

bool blender::ed::sculpt_paint::mask::mask_equals_array_grids ( Span< float > masks,
const CCGKey & key,
Span< int > grids,
Span< float > values )

Check whether array data is the same as the stored mask for the referenced geometry.

Definition at line 272 of file paint_mask.cc.

References blender::IndexRange::begin(), blender::BLI_assert(), blender::IndexRange::end(), blender::CCGKey::grid_area, blender::Span< T >::index_range(), mask_equals_array_grids(), and blender::Span< T >::size().

Referenced by apply_new_mask_grids(), and mask_equals_array_grids().

◆ mask_flood_fill_exec()

◆ mask_from_boundary_exec()

wmOperatorStatus blender::ed::sculpt_paint::mask::mask_from_boundary_exec ( bContext * C,
wmOperator * op )
static

Definition at line 1229 of file mesh/sculpt_ops.cc.

References blender::bke::pbvh::all_leaf_nodes(), apply_mask_from_settings(), blender::BKE_base_is_visible(), blender::BKE_paint_brush_for_read(), blender::BKE_report(), blender::BKE_sculpt_mask_layers_ensure(), blender::BKE_sculpt_multires_active(), blender::BKE_sculptsession_update_for_edit(), blender::MeshAutomaskingSettings::boundary_edges_propagation_steps, Brush, blender::BRUSH_AUTOMASKING_BOUNDARY_EDGES, blender::BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS, C, blender::ed::sculpt_paint::auto_mask::cache_init(), blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_depsgraph_pointer(), blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_data_tool_settings(), blender::CTX_wm_view3d(), FaceSets, blender::MeshAutomaskingSettings::flags, blender::ed::sculpt_paint::flush_update_done(), blender::ed::sculpt_paint::undo::Mask, blender::ed::sculpt_paint::Mask, mask_from_boundary_exec(), blender::ed::sculpt_paint::mask_overlay_check(), Mesh, blender::Brush::mesh_automasking_settings, blender::Paint::mesh_automasking_settings, Operator, blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::Sculpt::paint, blender::bke::object::pbvh_get(), blender::wmOperator::ptr, blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_end(), blender::ed::sculpt_paint::undo::push_nodes(), blender::wmOperator::reports, blender::RNA_enum_get(), blender::RNA_float_get(), blender::RNA_int_get(), blender::RPT_WARNING, Scene, blender::ToolSettings::sculpt, blender::Brush::sculpt_brush_type, blender::SCULPT_BRUSH_TYPE_SMOOTH, blender::dna::shallow_copy(), blender::ed::sculpt_paint::tag_update_overlays(), and blender::ed::sculpt_paint::vert_random_access_ensure().

Referenced by mask_from_boundary_exec(), and SCULPT_OT_mask_from_boundary().

◆ mask_from_boundary_ui()

◆ mask_from_cavity_exec()

wmOperatorStatus blender::ed::sculpt_paint::mask::mask_from_cavity_exec ( bContext * C,
wmOperator * op )
static

Definition at line 1004 of file mesh/sculpt_ops.cc.

References blender::bke::pbvh::all_leaf_nodes(), apply_mask_from_settings(), blender::BKE_base_is_visible(), blender::BKE_paint_brush_for_read(), blender::BKE_report(), blender::BKE_sculpt_mask_layers_ensure(), blender::BKE_sculpt_multires_active(), blender::BKE_sculptsession_update_for_edit(), blender::MeshAutomaskingSettings::boundary_edges_propagation_steps, Brush, blender::BRUSH_AUTOMASKING_CAVITY_ALL, blender::BRUSH_AUTOMASKING_CAVITY_INVERTED, blender::BRUSH_AUTOMASKING_CAVITY_NORMAL, blender::BRUSH_AUTOMASKING_CAVITY_USE_CURVE, C, blender::ed::sculpt_paint::auto_mask::cache_init(), blender::MeshAutomaskingSettings::cavity_blur_steps, blender::MeshAutomaskingSettings::cavity_curve, blender::MeshAutomaskingSettings::cavity_factor, blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_depsgraph_pointer(), blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_data_tool_settings(), blender::CTX_wm_view3d(), blender::MeshAutomaskingSettings::flags, blender::ed::sculpt_paint::flush_update_done(), blender::ed::sculpt_paint::undo::Mask, blender::ed::sculpt_paint::Mask, mask_from_cavity_exec(), blender::ed::sculpt_paint::mask_overlay_check(), blender::Brush::mesh_automasking_settings, blender::Paint::mesh_automasking_settings, Operator, blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::Sculpt::paint, blender::bke::object::pbvh_get(), blender::wmOperator::ptr, blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_end(), blender::ed::sculpt_paint::undo::push_nodes(), blender::wmOperator::reports, blender::RNA_boolean_get(), blender::RNA_enum_get(), blender::RNA_float_get(), blender::RNA_int_get(), blender::RPT_WARNING, Scene, blender::ToolSettings::sculpt, blender::Brush::sculpt_brush_type, blender::SCULPT_BRUSH_TYPE_SMOOTH, blender::dna::shallow_copy(), blender::ed::sculpt_paint::tag_update_overlays(), and blender::ed::sculpt_paint::vert_random_access_ensure().

Referenced by mask_from_cavity_exec(), and SCULPT_OT_mask_from_cavity().

◆ mask_from_cavity_ui()

◆ mask_gesture_get_new_value()

float blender::ed::sculpt_paint::mask::mask_gesture_get_new_value ( const float elem,
FloodFillMode mode,
float value )
static

◆ mask_increase_contrast()

BLI_NOINLINE void blender::ed::sculpt_paint::mask::mask_increase_contrast ( const Span< float > src,
const MutableSpan< float > dst )
static

◆ mix_new_masks() [1/2]

◆ mix_new_masks() [2/2]

void blender::ed::sculpt_paint::mask::mix_new_masks ( const Span< float > new_masks,
const Span< float > factors,
const MutableSpan< float > masks )

◆ multiply_add()

BLI_NOINLINE void blender::ed::sculpt_paint::mask::multiply_add ( const Span< float > src,
const float factor,
const float offset,
const MutableSpan< float > dst )
static

◆ PAINT_OT_mask_box_gesture()

◆ PAINT_OT_mask_flood_fill()

◆ PAINT_OT_mask_lasso_gesture()

◆ PAINT_OT_mask_line_gesture()

◆ PAINT_OT_mask_polyline_gesture()

◆ scatter_mask_bmesh()

◆ scatter_mask_grids()

void blender::ed::sculpt_paint::mask::scatter_mask_grids ( const Span< float > mask,
SubdivCCG & subdiv_ccg,
const Span< int > grids )

◆ sculpt_mask_filter_exec()

wmOperatorStatus blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec ( bContext * C,
wmOperator * op )
static

Definition at line 738 of file sculpt_filter_mask.cc.

References blender::bke::pbvh::all_leaf_nodes(), apply_new_mask_bmesh(), apply_new_mask_grids(), apply_new_mask_mesh(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::BKE_base_is_visible(), blender::BKE_sculpt_mask_layers_ensure(), blender::BKE_sculpt_multires_active(), blender::BKE_sculptsession_update_for_edit(), blender::BKE_subdiv_ccg_key_top_level(), blender::bm, blender::SculptSession::bm, blender::bke::pbvh::BMesh, C, blender::CD_PROP_FLOAT, ContrastDecrease, ContrastIncrease, blender::ed::sculpt_paint::create_node_vert_offsets(), blender::ed::sculpt_paint::create_node_vert_offsets_bmesh(), blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_depsgraph_pointer(), blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_wm_view3d(), blender::CustomData_get_offset_named(), blender::Object::data, decrease_contrast_mask_bmesh(), decrease_contrast_mask_grids(), decrease_contrast_mask_mesh(), blender::bke::Face, blender::ed::sculpt_paint::flush_update_done(), blender::ed::sculpt_paint::flush_update_step(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bools(), blender::exec_mode::grain_size(), blender::bke::pbvh::Grids, Grow, grow_mask_bmesh(), grow_mask_grids(), grow_mask_mesh(), increase_contrast_mask_bmesh(), increase_contrast_mask_grids(), increase_contrast_mask_mesh(), blender::IndexRange::IndexRange(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::ed::sculpt_paint::Mask, blender::ed::sculpt_paint::mask_overlay_check(), blender::bke::pbvh::Mesh, blender::index_mask::IndexMask::min_array_size(), blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::bke::object::pbvh_get(), blender::bke::Point, blender::wmOperator::ptr, blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_end(), blender::RNA_boolean_get(), blender::RNA_enum_get(), blender::RNA_int_get(), blender::Object::runtime, sculpt_mask_filter_exec(), blender::bke::ObjectRuntime::sculpt_session, Sharpen, sharpen_mask_bmesh(), sharpen_mask_grids(), sharpen_mask_mesh(), Shrink, shrink_mask_bmesh(), shrink_mask_grids(), shrink_mask_mesh(), Smooth, smooth_mask_bmesh(), smooth_mask_grids(), smooth_mask_mesh(), blender::SculptSession::subdiv_ccg, blender::ed::sculpt_paint::tag_update_overlays(), blender::offset_indices::OffsetIndices< T >::total_size(), blender::BMesh::vdata, blender::ed::sculpt_paint::vert_random_access_ensure(), and blender::ed::sculpt_paint::vertex_count_get().

Referenced by sculpt_mask_filter_exec(), and SCULPT_OT_mask_filter().

◆ sculpt_mask_init_exec()

wmOperatorStatus blender::ed::sculpt_paint::mask::sculpt_mask_init_exec ( bContext * C,
wmOperator * op )
static

Definition at line 111 of file sculpt_mask_init.cc.

References blender::bke::pbvh::all_leaf_nodes(), blender::BKE_base_is_visible(), blender::BKE_pbvh_bmesh_node_unique_verts(), blender::BKE_sculptsession_update_for_edit(), blender::BKE_subdiv_ccg_foreach_visible_grid_vert(), blender::BKE_subdiv_ccg_key_top_level(), blender::BLI_hash_int_01(), blender::BLI_time_now_seconds(), blender::SculptSession::bm, BM_ELEM_CD_SET_FLOAT, BM_elem_flag_test, blender::BM_ELEM_HIDDEN, BM_elem_index_get, blender::bke::pbvh::BMesh, C, blender::CD_PROP_FLOAT, blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_ensure_evaluated_depsgraph(), blender::CTX_data_main(), blender::CTX_data_scene(), blender::CTX_wm_view3d(), blender::CustomData_get_offset_named(), blender::Object::data, blender::ed::sculpt_paint::islands::ensure_cache(), blender::bke::Face, FaceSet, blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::CCGKey::grid_area, blender::SubdivCCG::grid_to_face_map, blender::bke::pbvh::Grids, init_mask_grids(), blender::index_mask::IndexMask::is_empty(), Island, blender::bke::AttributeAccessor::lookup_or_default(), blender::ed::sculpt_paint::undo::Mask, blender::ed::sculpt_paint::mask_overlay_check(), blender::bke::pbvh::Mesh, blender::bke::pbvh::node_update_mask_bmesh(), blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::bke::object::pbvh_get(), blender::wmOperator::ptr, blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_end(), blender::ed::sculpt_paint::undo::push_nodes(), Random, blender::RNA_enum_get(), blender::Object::runtime, sculpt_mask_init_exec(), blender::bke::ObjectRuntime::sculpt_session, blender::SculptSession::subdiv_ccg, blender::ed::sculpt_paint::tag_update_overlays(), blender::BMesh::vdata, blender::ed::sculpt_paint::face_set::vert_face_set_max_get(), blender::ed::sculpt_paint::islands::vert_id_get(), and write_mask_mesh().

Referenced by sculpt_mask_init_exec(), and SCULPT_OT_mask_init().

◆ SCULPT_OT_mask_by_color()

◆ SCULPT_OT_mask_filter()

◆ SCULPT_OT_mask_from_boundary()

◆ SCULPT_OT_mask_from_cavity()

◆ SCULPT_OT_mask_init()

◆ sharpen_mask_bmesh()

◆ sharpen_mask_grids()

◆ sharpen_mask_mesh()

◆ sharpen_masks()

BLI_NOINLINE void blender::ed::sculpt_paint::mask::sharpen_masks ( const Span< float > old_masks,
const MutableSpan< float > new_mask )
static

◆ shrink_mask_bmesh()

void blender::ed::sculpt_paint::mask::shrink_mask_bmesh ( const int mask_offset,
bke::pbvh::BMeshNode & node,
MutableSpan< float > new_mask )
static

◆ shrink_mask_grids()

◆ shrink_mask_mesh()

void blender::ed::sculpt_paint::mask::shrink_mask_mesh ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > vert_to_face,
const Span< bool > hide_poly,
const Span< bool > hide_vert,
const Span< float > mask,
const bke::pbvh::MeshNode & node,
FilterLocalData & tls,
MutableSpan< float > new_mask )
static

◆ smooth_mask_bmesh()

◆ smooth_mask_grids()

◆ smooth_mask_mesh()

◆ try_remove_mask_mesh()

◆ update_mask_mesh()

void blender::ed::sculpt_paint::mask::update_mask_mesh ( const Depsgraph & depsgraph,
Object & object,
const IndexMask & node_mask,
FunctionRef< void(MutableSpan< float >, Span< int >)> update_fn )

Write to each node's mask data for visible vertices. Store undo data and mark for redraw only if the data is actually changed.

Definition at line 197 of file paint_mask.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::data, blender::Span< T >::drop_front(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bools(), blender::ed::sculpt_paint::gather_data_mesh(), blender::exec_mode::grain_size(), blender::array_utils::indexed_data_equal(), blender::Span< T >::is_empty(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::ed::sculpt_paint::undo::Mask, blender::ed::sculpt_paint::mask::LocalData::mask, blender::index_mask::IndexMask::min_array_size(), blender::bke::pbvh::node_update_mask_mesh(), blender::ed::sculpt_paint::hide::node_visible_all_verts(), blender::ed::sculpt_paint::hide::node_visible_shared_verts(), blender::bke::object::pbvh_get(), blender::bke::Point, blender::ed::sculpt_paint::undo::push_node(), lexit::Vector< T >::resize(), blender::ed::sculpt_paint::scatter_data_mesh(), blender::Span< T >::size(), blender::Span< T >::take_front(), and update_mask_mesh().

Referenced by gesture_apply_for_symmetry_pass(), mask_by_color_contiguous_mesh(), mask_by_color_full_mesh(), blender::ed::sculpt_paint::expand::update_for_vert(), and update_mask_mesh().

◆ write_mask_mesh()

Variable Documentation

◆ mix_modes

EnumPropertyItem blender::ed::sculpt_paint::mask::mix_modes[]
static
Initial value:
= {
{int(ApplyMaskMode::Mix), "MIX", ICON_NONE, "Mix", ""},
{int(ApplyMaskMode::Multiply), "MULTIPLY", ICON_NONE, "Multiply", ""},
{int(ApplyMaskMode::Divide), "DIVIDE", ICON_NONE, "Divide", ""},
{int(ApplyMaskMode::Add), "ADD", ICON_NONE, "Add", ""},
{int(ApplyMaskMode::Subtract), "SUBTRACT", ICON_NONE, "Subtract", ""},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 784 of file mesh/sculpt_ops.cc.

Referenced by SCULPT_OT_mask_from_boundary(), and SCULPT_OT_mask_from_cavity().

◆ mode_items

const EnumPropertyItem blender::ed::sculpt_paint::mask::mode_items[]
static
Initial value:
= {
"VALUE",
0,
"Value",
"Set mask to the level specified by the 'value' property"},
"VALUE_INVERSE",
0,
"Value Inverted",
"Set mask to the level specified by the inverted 'value' property"},
{int(FloodFillMode::InverseMeshValue), "INVERT", 0, "Invert", "Invert the mask"},
{0}}

Definition at line 323 of file paint_mask.cc.

Referenced by gesture_operator_properties(), and PAINT_OT_mask_flood_fill().

◆ settings_sources

EnumPropertyItem blender::ed::sculpt_paint::mask::settings_sources[]
static
Initial value:
= {
"OPERATOR",
ICON_NONE,
"Operator",
"Use settings from operator properties"},
{int(MaskSettingsSource::Brush), "BRUSH", ICON_NONE, "Brush", "Use settings from brush"},
{int(MaskSettingsSource::Scene), "SCENE", ICON_NONE, "Scene", "Use settings from scene"},
{0, nullptr, 0, nullptr, nullptr}}

Definition at line 795 of file mesh/sculpt_ops.cc.

Referenced by SCULPT_OT_mask_from_boundary(), and SCULPT_OT_mask_from_cavity().