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

Classes

struct  FaceSetOperation

Functions

int active_face_set_get (const Object &object)
int vert_face_set_max_get (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert)
int vert_face_set_get (const SubdivCCG &subdiv_ccg, const Span< int > face_sets, const int grid)
int vert_face_set_max_get (const int, const BMVert &)
Set< int > vert_face_sets_get (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert)
bool vert_has_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const int vert, const int face_set)
bool vert_has_face_set (const SubdivCCG &subdiv_ccg, const Span< int > face_sets, const int grid, const int face_set)
bool vert_has_face_set (const int face_set_offset, const BMVert &vert, const int face_set)
bool vert_has_any_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, int vert, const Set< int > &allowed_face_sets)
bool vert_has_unique_face_set (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, int vert)
static bool sculpt_check_unique_face_set_for_edge_in_base_mesh (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const Span< int > corner_verts, const OffsetIndices< int > faces, int v1, int v2)
bool vert_has_unique_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, SubdivCCGCoord coord)
bool coord_has_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord coord, const int face_set)
bool coord_has_any_face_set (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, const SubdivCCGCoord coord, const Set< int > &allowed_face_sets)
bool vert_has_unique_face_set (const int, const BMVert &)
Public API
int find_next_available_id (const Mesh &mesh)
int find_next_available_id (Object &object)
void initialize_none_to_id (Mesh *mesh, int new_id)
int active_update_and_get (bContext *C, Object &ob, const float mval_fl[2])
bool create_face_sets_mesh (Object &object)
bke::SpanAttributeWriter< int > ensure_face_sets_mesh (Mesh &mesh)
int ensure_face_sets_bmesh (Object &object)
Array< int > duplicate_face_sets (const Mesh &mesh)
void filter_verts_with_unique_face_sets_mesh (const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const bool unique, const Span< int > verts, const MutableSpan< float > factors)
void filter_verts_with_unique_face_sets_grids (const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, const SubdivCCG &subdiv_ccg, const bool unique, const Span< int > grids, const MutableSpan< float > factors)
void filter_verts_with_unique_face_sets_bmesh (int face_set_offset, const bool unique, const Set< BMVert *, 0 > &verts, const MutableSpan< float > factors)
Gesture Operators

Operators that modify face sets based on a selected area.

void fill_factor_from_hide_and_mask (const BMesh &bm, const Set< BMFace *, 0L > &faces, const MutableSpan< float > r_factors)
void fill_factor_from_hide_and_mask (const Mesh &mesh, const Span< int > face_indices, const MutableSpan< float > r_factors)
void calc_face_centers (const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< float3 > vert_positions, const Span< int > face_indices, const MutableSpan< float3 > positions)
void calc_face_centers (const Set< BMFace *, 0L > &faces, const MutableSpan< float3 > centers)
void calc_face_indices_grids (const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< int > &face_indices)
static void gesture_begin (bContext &C, wmOperator &op, gesture::GestureData &gesture_data)
static void gesture_apply_mesh (gesture::GestureData &gesture_data, const IndexMask &node_mask)
static void gesture_apply_bmesh (gesture::GestureData &gesture_data, const IndexMask &node_mask)
static void gesture_apply_for_symmetry_pass (bContext &, gesture::GestureData &gesture_data)
static void gesture_end (bContext &, gesture::GestureData &gesture_data)
static void init_operation (gesture::GestureData &gesture_data, wmOperator &)
static wmOperatorStatus gesture_box_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus gesture_box_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_lasso_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus gesture_lasso_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_line_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus gesture_line_exec (bContext *C, wmOperator *op)
static wmOperatorStatus gesture_polyline_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus gesture_polyline_exec (bContext *C, wmOperator *op)
void SCULPT_OT_face_set_polyline_gesture (wmOperatorType *ot)
void SCULPT_OT_face_set_box_gesture (wmOperatorType *ot)
void SCULPT_OT_face_set_lasso_gesture (wmOperatorType *ot)
void SCULPT_OT_face_set_line_gesture (wmOperatorType *ot)

Variables

constexpr float FACE_SET_MIN_FADE = 0.05f

Global Mesh Operators

Operators that work on the mesh as a whole.

enum class  CreateMode { Masked = 0 , Visible = 1 , All = 2 , Selection = 3 }
enum class  InitMode {
  LooseParts = 0 , Materials = 1 , Normals = 2 , UVSeams = 3 ,
  Creases = 4 , SharpEdges = 5 , BevelWeight = 6 , FaceSetBoundaries = 8
}
enum class  VisibilityMode { Toggle = 0 , ShowActive = 1 , HideActive = 2 }
enum class  EditMode {
  Grow = 0 , Shrink = 1 , DeleteGeometry = 2 , FairPositions = 3 ,
  FairTangency = 4
}
using FaceSetsFloodFillFn = FunctionRef<bool(int from_face, int edge, int to_face)>
static void face_sets_update (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const FunctionRef< void(Span< int >, MutableSpan< int >)> calc_face_sets)
static void clear_face_sets (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static wmOperatorStatus create_op_exec (bContext *C, wmOperator *op)
void SCULPT_OT_face_sets_create (wmOperatorType *ot)
static void init_flood_fill (Object &ob, const FaceSetsFloodFillFn &test_fn)
Set< int > gather_hidden_face_sets (const Span< bool > hide_poly, const Span< int > face_sets)
static wmOperatorStatus init_op_exec (bContext *C, wmOperator *op)
void SCULPT_OT_face_sets_init (wmOperatorType *ot)
static void face_hide_update (const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const FunctionRef< void(Span< int >, MutableSpan< bool >)> calc_hide)
static void show_all (Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static wmOperatorStatus change_visibility_exec (bContext *C, wmOperator *op)
static wmOperatorStatus change_visibility_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_face_set_change_visibility (wmOperatorType *ot)
static wmOperatorStatus randomize_colors_exec (bContext *C, wmOperator *)
void SCULPT_OT_face_sets_randomize_colors (wmOperatorType *ot)
static void edit_grow_shrink (const Depsgraph &depsgraph, const Scene &scene, Object &object, const EditMode mode, const int active_face_set_id, const bool modify_hidden, wmOperator *op)
static bool check_single_face_set (const Object &object, const bool check_visible_only)
static void delete_geometry (Object &ob, const int active_face_set_id, const bool modify_hidden)
static void edit_fairing (const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const int active_face_set_id, const eMeshFairingDepth fair_order, const float strength)
static bool edit_is_operation_valid (const Object &object, const EditMode mode, const bool modify_hidden)
static void edit_modify_geometry (bContext *C, Object &ob, const int active_face_set, const bool modify_hidden, wmOperator *op)
static void edit_modify_coordinates (bContext *C, Object &ob, const int active_face_set, const EditMode mode, wmOperator *op)
static bool edit_op_init (bContext *C, wmOperator *op)
static wmOperatorStatus edit_op_exec (bContext *C, wmOperator *op)
static wmOperatorStatus edit_op_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_face_sets_edit (wmOperatorType *ot)

Typedef Documentation

◆ FaceSetsFloodFillFn

using blender::ed::sculpt_paint::face_set::FaceSetsFloodFillFn = FunctionRef<bool(int from_face, int edge, int to_face)>

Definition at line 624 of file sculpt_face_set.cc.

Enumeration Type Documentation

◆ CreateMode

Enumerator
Masked 
Visible 
All 
Selection 

Definition at line 356 of file sculpt_face_set.cc.

◆ EditMode

Enumerator
Grow 
Shrink 
DeleteGeometry 
FairPositions 
FairTangency 

Definition at line 1222 of file sculpt_face_set.cc.

◆ InitMode

Enumerator
LooseParts 
Materials 
Normals 
UVSeams 
Creases 
SharpEdges 
BevelWeight 
FaceSetBoundaries 

Definition at line 613 of file sculpt_face_set.cc.

◆ VisibilityMode

Enumerator
Toggle 
ShowActive 
HideActive 

Definition at line 908 of file sculpt_face_set.cc.

Function Documentation

◆ active_face_set_get()

◆ active_update_and_get()

◆ calc_face_centers() [1/2]

void blender::ed::sculpt_paint::face_set::calc_face_centers ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< float3 > vert_positions,
const Span< int > face_indices,
const MutableSpan< float3 > positions )

◆ calc_face_centers() [2/2]

◆ calc_face_indices_grids()

void blender::ed::sculpt_paint::face_set::calc_face_indices_grids ( const SubdivCCG & subdiv_ccg,
const Span< int > grids,
const MutableSpan< int > & face_indices )

◆ change_visibility_exec()

◆ change_visibility_invoke()

◆ check_single_face_set()

bool blender::ed::sculpt_paint::face_set::check_single_face_set ( const Object & object,
const bool check_visible_only )
static

◆ clear_face_sets()

◆ coord_has_any_face_set()

◆ coord_has_face_set()

bool blender::ed::sculpt_paint::face_set::coord_has_face_set ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
const SubdivCCG & subdiv_ccg,
const SubdivCCGCoord coord,
const int face_set )

◆ create_face_sets_mesh()

bool blender::ed::sculpt_paint::face_set::create_face_sets_mesh ( Object & object)

◆ create_op_exec()

wmOperatorStatus blender::ed::sculpt_paint::face_set::create_op_exec ( bContext * C,
wmOperator * op )
static

Definition at line 415 of file sculpt_face_set.cc.

References All, blender::bke::pbvh::all_leaf_nodes(), blender::array_utils::AllFalse, blender::array_utils::AllTrue, blender::Span< T >::begin(), blender::BKE_base_is_visible(), blender::BKE_sculptsession_update_for_edit(), blender::bke::pbvh::BMesh, blender::array_utils::booleans_mix_calc(), C, clear_face_sets(), create_op_exec(), blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_depsgraph_pointer(), blender::CTX_data_scene(), blender::CTX_wm_view3d(), blender::data, blender::Span< T >::end(), blender::bke::Face, blender::bke::ccg::face_range(), blender::ed::sculpt_paint::face_set_overlay_check(), face_sets_update(), blender::MutableSpan< T >::fill(), find_next_available_id(), blender::SubdivCCG::grid_area, blender::bke::pbvh::Grids, blender::Span< T >::index_range(), blender::blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::bke::AttributeAccessor::lookup_or_default(), Masked, blender::SubdivCCG::masks, blender::bke::pbvh::Mesh, blender::array_utils::Mixed, blender::array_utils::None, 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_enum_get(), Selection, blender::Span< T >::slice(), blender::SculptSession::subdiv_ccg, blender::ed::sculpt_paint::tag_update_overlays(), and Visible.

Referenced by create_op_exec(), and SCULPT_OT_face_sets_create().

◆ delete_geometry()

◆ duplicate_face_sets()

◆ edit_fairing()

◆ edit_grow_shrink()

◆ edit_is_operation_valid()

bool blender::ed::sculpt_paint::face_set::edit_is_operation_valid ( const Object & object,
const EditMode mode,
const bool modify_hidden )
static

◆ edit_modify_coordinates()

◆ edit_modify_geometry()

◆ edit_op_exec()

◆ edit_op_init()

◆ edit_op_invoke()

◆ ensure_face_sets_bmesh()

◆ ensure_face_sets_mesh()

◆ face_hide_update()

◆ face_sets_update()

◆ fill_factor_from_hide_and_mask() [1/2]

◆ fill_factor_from_hide_and_mask() [2/2]

◆ filter_verts_with_unique_face_sets_bmesh()

◆ filter_verts_with_unique_face_sets_grids()

◆ filter_verts_with_unique_face_sets_mesh()

void blender::ed::sculpt_paint::face_set::filter_verts_with_unique_face_sets_mesh ( const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
const bool unique,
const Span< int > verts,
const MutableSpan< float > factors )

◆ find_next_available_id() [1/2]

◆ find_next_available_id() [2/2]

◆ gather_hidden_face_sets()

Set< int > blender::ed::sculpt_paint::face_set::gather_hidden_face_sets ( const Span< bool > hide_poly,
const Span< int > face_sets )

◆ gesture_apply_bmesh()

◆ gesture_apply_for_symmetry_pass()

◆ gesture_apply_mesh()

void blender::ed::sculpt_paint::face_set::gesture_apply_mesh ( gesture::GestureData & gesture_data,
const IndexMask & node_mask )
static

Definition at line 1801 of file sculpt_face_set.cc.

References calc_face_centers(), calc_face_indices_grids(), blender::data, blender::ViewContext::depsgraph, ensure_face_sets_mesh(), blender::bke::mesh::face_center_calc(), blender::bke::mesh::face_normal_calc(), FACE_SET_MIN_FADE, blender::ed::sculpt_paint::undo::FaceSet, fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::fill_factor_from_hide_and_mask(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::bke::SpanAttributeWriter< T >::finish(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_bools(), blender::ed::sculpt_paint::gather_grids_positions(), gesture_apply_mesh(), blender::exec_mode::grain_size(), blender::bke::pbvh::Grids, blender::Span< T >::index_range(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::ed::sculpt_paint::gesture::is_affected(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::bke::pbvh::Mesh, blender::ed::sculpt_paint::face_set::FaceSetOperation::new_face_set_id, blender::ViewContext::obact, blender::ed::sculpt_paint::gesture::GestureData::operation, blender::bke::object::pbvh_get(), blender::ed::sculpt_paint::undo::push_node(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), blender::Span< T >::slice(), blender::bke::SpanAttributeWriter< T >::span, blender::ed::sculpt_paint::gesture::GestureData::ss, blender::SculptSession::subdiv_ccg, blender::ed::sculpt_paint::gesture::GestureData::vc, and blender::bke::pbvh::vert_positions_eval().

Referenced by gesture_apply_for_symmetry_pass(), and gesture_apply_mesh().

◆ gesture_begin()

◆ gesture_box_exec()

◆ gesture_box_invoke()

◆ gesture_end()

void blender::ed::sculpt_paint::face_set::gesture_end ( bContext & ,
gesture::GestureData & gesture_data )
static

◆ gesture_lasso_exec()

◆ gesture_lasso_invoke()

◆ gesture_line_exec()

◆ gesture_line_invoke()

◆ gesture_polyline_exec()

◆ gesture_polyline_invoke()

◆ init_flood_fill()

◆ init_op_exec()

◆ init_operation()

◆ initialize_none_to_id()

◆ randomize_colors_exec()

◆ sculpt_check_unique_face_set_for_edge_in_base_mesh()

bool blender::ed::sculpt_paint::face_set::sculpt_check_unique_face_set_for_edge_in_base_mesh ( const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
const Span< int > corner_verts,
const OffsetIndices< int > faces,
int v1,
int v2 )
static

Checks if the face sets of the adjacent faces to the edge between v1 and v2 in the base mesh are equal.

Definition at line 350 of file sculpt.cc.

References sculpt_check_unique_face_set_for_edge_in_base_mesh(), blender::Span< T >::size(), and blender::v2.

Referenced by sculpt_check_unique_face_set_for_edge_in_base_mesh(), and vert_has_unique_face_set().

◆ SCULPT_OT_face_set_box_gesture()

◆ SCULPT_OT_face_set_change_visibility()

◆ SCULPT_OT_face_set_lasso_gesture()

◆ SCULPT_OT_face_set_line_gesture()

◆ SCULPT_OT_face_set_polyline_gesture()

◆ SCULPT_OT_face_sets_create()

◆ SCULPT_OT_face_sets_edit()

◆ SCULPT_OT_face_sets_init()

◆ SCULPT_OT_face_sets_randomize_colors()

◆ show_all()

◆ vert_face_set_get()

int blender::ed::sculpt_paint::face_set::vert_face_set_get ( const SubdivCCG & subdiv_ccg,
const Span< int > face_sets,
const int grid )

◆ vert_face_set_max_get() [1/2]

◆ vert_face_set_max_get() [2/2]

int blender::ed::sculpt_paint::face_set::vert_face_set_max_get ( const int ,
const BMVert &  )

Definition at line 249 of file sculpt.cc.

References vert_face_set_max_get().

◆ vert_face_sets_get()

Set< int > blender::ed::sculpt_paint::face_set::vert_face_sets_get ( const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
const int vert )

Definition at line 254 of file sculpt.cc.

References blender::result, and vert_face_sets_get().

Referenced by vert_face_sets_get().

◆ vert_has_any_face_set()

bool blender::ed::sculpt_paint::face_set::vert_has_any_face_set ( const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
int vert,
const Set< int > & allowed_face_sets )

◆ vert_has_face_set() [1/3]

◆ vert_has_face_set() [2/3]

bool blender::ed::sculpt_paint::face_set::vert_has_face_set ( const int face_set_offset,
const BMVert & vert,
const int face_set )

◆ vert_has_face_set() [3/3]

bool blender::ed::sculpt_paint::face_set::vert_has_face_set ( const SubdivCCG & subdiv_ccg,
const Span< int > face_sets,
const int grid,
const int face_set )

◆ vert_has_unique_face_set() [1/3]

bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set ( const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
int vert )

Definition at line 324 of file sculpt.cc.

References blender::Span< T >::is_empty(), and vert_has_unique_face_set().

Referenced by blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::ed::sculpt_paint::auto_mask::calc_interpolated_face_factors(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_bmesh(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_faces(), blender::ed::sculpt_paint::smooth::calc_relaxed_translations_grids(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), edit_fairing(), filter_verts_with_unique_face_sets_bmesh(), filter_verts_with_unique_face_sets_grids(), filter_verts_with_unique_face_sets_mesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_bmesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_fk_bmesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_fk_grids(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_fk_mesh(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_grids(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), blender::ed::sculpt_paint::auto_mask::init_boundary_masking_bmesh(), blender::ed::sculpt_paint::auto_mask::init_boundary_masking_grids(), blender::ed::sculpt_paint::auto_mask::init_boundary_masking_mesh(), blender::ed::sculpt_paint::expand::init_from_face_set_boundary(), vert_has_unique_face_set(), vert_has_unique_face_set(), and vert_has_unique_face_set().

◆ vert_has_unique_face_set() [2/3]

bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set ( const int ,
const BMVert &  )

Definition at line 481 of file sculpt.cc.

References vert_has_unique_face_set().

◆ vert_has_unique_face_set() [3/3]

bool blender::ed::sculpt_paint::face_set::vert_has_unique_face_set ( const OffsetIndices< int > faces,
const Span< int > corner_verts,
const GroupedSpan< int > vert_to_face_map,
const Span< int > face_sets,
const SubdivCCG & subdiv_ccg,
SubdivCCGCoord coord )

Variable Documentation

◆ FACE_SET_MIN_FADE

float blender::ed::sculpt_paint::face_set::FACE_SET_MIN_FADE = 0.05f
constexpr

Definition at line 76 of file sculpt_face_set.hh.

Referenced by gesture_apply_bmesh(), and gesture_apply_mesh().