Blender V4.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_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< intensure_face_sets_mesh (Mesh &mesh)
 
int ensure_face_sets_bmesh (Object &object)
 
Array< intduplicate_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 int gesture_box_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int gesture_box_exec (bContext *C, wmOperator *op)
 
static int gesture_lasso_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int gesture_lasso_exec (bContext *C, wmOperator *op)
 
static int gesture_line_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int gesture_line_exec (bContext *C, wmOperator *op)
 
static int gesture_polyline_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int 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 int 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< intgather_hidden_face_sets (const Span< bool > hide_poly, const Span< int > face_sets)
 
static int 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 int change_visibility_exec (bContext *C, wmOperator *op)
 
static int change_visibility_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SCULPT_OT_face_set_change_visibility (wmOperatorType *ot)
 
static int 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 int edit_op_exec (bContext *C, wmOperator *op)
 
static int edit_op_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void SCULPT_OT_face_sets_edit (wmOperatorType *ot)
 

Typedef Documentation

◆ FaceSetsFloodFillFn

Definition at line 609 of file sculpt_face_set.cc.

Enumeration Type Documentation

◆ CreateMode

Enumerator
Masked 
Visible 
All 
Selection 

Definition at line 347 of file sculpt_face_set.cc.

◆ EditMode

Enumerator
Grow 
Shrink 
DeleteGeometry 
FairPositions 
FairTangency 

Definition at line 1196 of file sculpt_face_set.cc.

◆ InitMode

Enumerator
LooseParts 
Materials 
Normals 
UVSeams 
Creases 
SharpEdges 
BevelWeight 
FaceSetBoundaries 

Definition at line 598 of file sculpt_face_set.cc.

◆ VisibilityMode

Enumerator
Toggle 
ShowActive 
HideActive 

Definition at line 891 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()

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

Creates the sculpt face set attribute on the mesh if it doesn't exist.

See also
face_set::ensure_face_sets_mesh if further writing to the attribute is desired.

Definition at line 151 of file sculpt_face_set.cc.

References blender::bke::MutableAttributeAccessor::add(), and create_face_sets_mesh().

Referenced by create_face_sets_mesh(), and blender::ed::sculpt_paint::trim::gesture_begin().

◆ create_op_exec()

◆ delete_geometry()

◆ duplicate_face_sets()

Array< int > blender::ed::sculpt_paint::face_set::duplicate_face_sets ( const Mesh & mesh)

◆ edit_fairing()

◆ edit_grow_shrink()

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

◆ edit_is_operation_valid()

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

static void blender::ed::sculpt_paint::face_set::edit_modify_geometry ( bContext * C,
Object & ob,
const int active_face_set,
const bool modify_hidden,
wmOperator * op )
static

◆ edit_op_exec()

◆ edit_op_init()

static bool blender::ed::sculpt_paint::face_set::edit_op_init ( bContext * C,
wmOperator * op )
static

◆ edit_op_invoke()

◆ ensure_face_sets_bmesh()

◆ ensure_face_sets_mesh()

bke::SpanAttributeWriter< int > blender::ed::sculpt_paint::face_set::ensure_face_sets_mesh ( Mesh & mesh)

Ensures that the sculpt face set attribute exists on the mesh.

See also
face_set::create_face_sets_mesh to avoid having to remember to call .finish()

Definition at line 165 of file sculpt_face_set.cc.

References blender::bke::MutableAttributeAccessor::add(), and ensure_face_sets_mesh().

Referenced by ensure_face_sets_mesh(), face_sets_update(), init_flood_fill(), init_op_exec(), and blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step().

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

static void blender::ed::sculpt_paint::face_set::gesture_begin ( bContext & C,
wmOperator & op,
gesture::GestureData & gesture_data )
static

◆ gesture_box_exec()

static int blender::ed::sculpt_paint::face_set::gesture_box_exec ( bContext * C,
wmOperator * op )
static

◆ gesture_box_invoke()

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

◆ gesture_end()

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

◆ gesture_lasso_exec()

static int blender::ed::sculpt_paint::face_set::gesture_lasso_exec ( bContext * C,
wmOperator * op )
static

◆ gesture_lasso_invoke()

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

◆ gesture_line_exec()

static int blender::ed::sculpt_paint::face_set::gesture_line_exec ( bContext * C,
wmOperator * op )
static

◆ gesture_line_invoke()

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

◆ gesture_polyline_exec()

static int blender::ed::sculpt_paint::face_set::gesture_polyline_exec ( bContext * C,
wmOperator * op )
static

◆ gesture_polyline_invoke()

static int 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()

static 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 320 of file sculpt.cc.

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

◆ SCULPT_OT_face_sets_edit()

◆ SCULPT_OT_face_sets_init()

◆ SCULPT_OT_face_sets_randomize_colors()

◆ show_all()

static void blender::ed::sculpt_paint::face_set::show_all ( Depsgraph & depsgraph,
Object & object,
const IndexMask & node_mask )
static

Definition at line 968 of file sculpt_face_set.cc.

References BLI_assert_unreachable, depsgraph, and show_all().

Referenced by change_visibility_exec(), and 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 249 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 243 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 279 of file sculpt.cc.

References BM_ELEM_CD_GET_INT, BM_FACES_OF_VERT, and BM_ITER_ELEM.

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

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