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

Classes

struct  FaceSetOperation

Functions

int active_face_set_get (const Object &object)
int vert_face_set_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_get (const int, const BMVert &)
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_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 vert_has_unique_face_set (const int, const BMVert &)
Public API
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.

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)

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 611 of file sculpt_face_set.cc.

Enumeration Type Documentation

◆ CreateMode

Enumerator
Masked 
Visible 
All 
Selection 

Definition at line 349 of file sculpt_face_set.cc.

◆ EditMode

Enumerator
Grow 
Shrink 
DeleteGeometry 
FairPositions 
FairTangency 

Definition at line 1199 of file sculpt_face_set.cc.

◆ InitMode

Enumerator
LooseParts 
Materials 
Normals 
UVSeams 
Creases 
SharpEdges 
BevelWeight 
FaceSetBoundaries 

Definition at line 600 of file sculpt_face_set.cc.

◆ VisibilityMode

Enumerator
Toggle 
ShowActive 
HideActive 

Definition at line 893 of file sculpt_face_set.cc.

Function Documentation

◆ active_face_set_get()

◆ active_update_and_get()

int blender::ed::sculpt_paint::face_set::active_update_and_get ( bContext * C,
Object & ob,
const float mval_fl[2] )

◆ 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()

◆ 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

◆ delete_geometry()

◆ duplicate_face_sets()

◆ edit_fairing()

◆ edit_grow_shrink()

◆ edit_is_operation_valid()

◆ 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()

◆ filter_verts_with_unique_face_sets_bmesh()

void blender::ed::sculpt_paint::face_set::filter_verts_with_unique_face_sets_bmesh ( int face_set_offset,
const bool unique,
const Set< BMVert *, 0 > & verts,
const MutableSpan< float > factors )

◆ filter_verts_with_unique_face_sets_grids()

void blender::ed::sculpt_paint::face_set::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 )

◆ 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()

◆ 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()

◆ gesture_begin()

◆ gesture_box_exec()

◆ gesture_box_invoke()

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

◆ gesture_end()

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

◆ gesture_lasso_exec()

◆ gesture_lasso_invoke()

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

◆ gesture_line_exec()

◆ gesture_line_invoke()

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

◆ gesture_polyline_exec()

◆ gesture_polyline_invoke()

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

◆ 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 318 of file sculpt.cc.

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

Referenced by 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()

void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_create ( wmOperatorType * ot)

◆ SCULPT_OT_face_sets_edit()

◆ SCULPT_OT_face_sets_init()

◆ SCULPT_OT_face_sets_randomize_colors()

void blender::ed::sculpt_paint::face_set::SCULPT_OT_face_sets_randomize_colors ( wmOperatorType * ot)

◆ show_all()

◆ vert_face_set_get() [1/3]

◆ vert_face_set_get() [2/3]

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

Definition at line 247 of file sculpt.cc.

References SCULPT_FACE_SET_NONE.

◆ vert_face_set_get() [3/3]

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

Definition at line 241 of file sculpt.cc.

References BKE_subdiv_ccg_grid_to_face_index().

◆ 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 )

Definition at line 277 of file sculpt.cc.

References BM_ELEM_CD_GET_INT, BM_FACES_OF_VERT, BM_ITER_ELEM, and SCULPT_FACE_SET_NONE.

◆ 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 )

◆ 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 378 of file sculpt.cc.

◆ 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 )