90 for (const int id : face_sets.slice(range)) {
91 max = std::max(max, id);
95 [](
const int a,
const int b) {
return std::max(a,
b); });
102 if (cd_offset == -1) {
105 int next_face_set = 1;
110 next_face_set = std::max(next_face_set, fset);
113 return next_face_set + 1;
129 for (
const int i : face_sets.
span.index_range()) {
131 face_sets.
span[i] = new_id;
155 if (attributes.
contains(
".sculpt_face_set")) {
158 attributes.
add<
int>(
".sculpt_face_set",
161 mesh.face_sets_color_default = 1;
168 if (!attributes.
contains(
".sculpt_face_set")) {
169 attributes.
add<
int>(
".sculpt_face_set",
172 mesh.face_sets_color_default = 1;
193 mesh.face_sets_color_default = 1;
217 for (
const int i :
verts.index_range()) {
237 const int node_start = i * key.
grid_area;
241 const int node_vert = node_start + offset;
242 if (factors[node_vert] == 0.0f) {
251 faces, corner_verts, vert_to_face_map, face_sets, subdiv_ccg, coord))
253 factors[node_vert] = 0.0f;
305 TLS &tls = all_tls.
local();
308 tls.new_face_sets.resize(
faces.size());
311 calc_face_sets(
faces, new_face_sets);
318 node_changed[i] =
true;
324 TLS &tls = all_tls.
local();
328 tls.new_face_sets.resize(
faces.size());
331 calc_face_sets(
faces, new_face_sets);
338 node_changed[i] =
true;
358 if (!attributes.
contains(
".sculpt_face_set")) {
366 const int default_face_set =
mesh.face_sets_color_default;
372 if (std::any_of(
faces.begin(),
faces.end(), [&](
const int face) {
373 return face_sets[face] != default_face_set;
377 node_changed[i] =
true;
388 if (std::any_of(
faces.begin(),
faces.end(), [&](
const int face) {
389 return face_sets[face] != default_face_set;
393 node_changed[i] =
true;
399 attributes.
remove(
".sculpt_face_set");
442 if (!
mask.is_empty()) {
447 for (
const int i :
indices.index_range()) {
452 if (!std::any_of(face_verts.
begin(),
454 [&](
const int vert) { return mask[vert] > 0.5f; }))
458 face_sets[i] = next_face_set;
467 const int grid_area = subdiv_ccg.
grid_area;
471 if (!masks.is_empty()) {
476 for (
const int i :
indices.index_range()) {
483 if (!std::any_of(face_masks.
begin(),
485 [&](
const float mask) { return mask > 0.5f; }))
489 face_sets[i] = next_face_set;
513 for (
const int i :
indices.index_range()) {
514 if (!hide_poly_span[
indices[i]]) {
515 face_sets[i] = next_face_set;
528 face_sets.
fill(next_face_set);
540 for (
const int i :
indices.index_range()) {
542 if (!hide_poly.is_empty() && hide_poly[i]) {
545 face_sets[i] = next_face_set;
563 ot->name =
"Create Face Set";
564 ot->idname =
"SCULPT_OT_face_sets_create";
565 ot->description =
"Create a new Face Set";
576 "Face Set from Masked",
577 "Create a new Face Set from the masked faces"},
581 "Face Set from Visible",
582 "Create a new Face Set from the visible vertices"},
586 "Face Set Full Mesh",
587 "Create an unique Face Set with all faces in the sculpt"},
591 "Face Set from Edit Mode Selection",
592 "Create an Face Set corresponding to the Edit Mode face selection"},
593 {0,
nullptr, 0,
nullptr,
nullptr},
633 int next_face_set = 1;
635 for (
const int i :
faces.index_range()) {
636 if (!hide_poly.
is_empty() && hide_poly[i]) {
639 if (visited_faces[i]) {
642 std::queue<int> queue;
644 while (hidden_face_sets.contains(next_face_set)) {
647 face_sets.
span[i] = next_face_set;
648 visited_faces[i].set(
true);
651 while (!queue.empty()) {
652 const int face_i = queue.front();
655 for (
const int edge_i : corner_edges.
slice(
faces[face_i])) {
657 if (neighbor_i == face_i) {
660 if (visited_faces[neighbor_i]) {
663 if (!hide_poly.
is_empty() && hide_poly[neighbor_i]) {
666 if (!test_fn(face_i, edge_i, neighbor_i)) {
670 face_sets.
span[neighbor_i] = next_face_set;
671 visited_faces[neighbor_i].set(
true);
672 queue.push(neighbor_i);
692 hidden_face_sets.
add(face_sets[i]);
696 return hidden_face_sets;
739 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) {
740 return hide_poly[from_face] == hide_poly[to_face];
751 if (!hide_poly.is_empty() && hide_poly[i]) {
757 face_sets.
span[i] = material_indices[i] + 1;
765 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
766 return std::abs(
math::dot(face_normals[from_face], face_normals[to_face])) > threshold;
774 [&](
const int ,
const int edge,
const int ) ->
bool {
775 return !uv_seams[edge];
783 [&](
const int ,
const int edge,
const int ) ->
bool {
784 return creases[edge] < threshold;
792 [&](
const int ,
const int edge,
const int ) ->
bool {
793 return !sharp_edges[edge];
801 [&](
const int ,
const int edge,
const int ) ->
bool {
802 return bevel_weights[edge] < threshold;
808 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
809 return face_sets_copy[from_face] == face_sets_copy[to_face];
826 ot->name =
"Init Face Sets";
827 ot->idname =
"SCULPT_OT_face_sets_init";
828 ot->description =
"Initializes all Face Sets in the mesh";
839 "Face Sets from Loose Parts",
840 "Create a Face Set per loose part in the mesh"},
844 "Face Sets from Material Slots",
845 "Create a Face Set per Material Slot"},
849 "Face Sets from Mesh Normals",
850 "Create Face Sets for Faces that have similar normal"},
854 "Face Sets from UV Seams",
855 "Create Face Sets using UV Seams as boundaries"},
859 "Face Sets from Edge Creases",
860 "Create Face Sets using Edge Creases as boundaries"},
864 "Face Sets from Bevel Weight",
865 "Create Face Sets using Bevel Weights as boundaries"},
869 "Face Sets from Sharp Edges",
870 "Create Face Sets using Sharp Edges as boundaries"},
872 "FACE_SET_BOUNDARIES",
874 "Face Sets from Face Set Boundaries",
875 "Create a Face Set per isolated Face Set"},
876 {0,
nullptr, 0,
nullptr,
nullptr},
886 "Minimum value to consider a certain attribute a boundary when creating the Face Sets",
920 TLS &tls = all_tls.
local();
923 tls.new_hide.resize(
faces.size());
926 calc_hide(
faces, new_hide);
933 node_changed[i] =
true;
939 TLS &tls = all_tls.
local();
943 tls.new_hide.resize(
faces.size());
946 calc_hide(
faces, new_hide);
953 node_changed[i] =
true;
1015 if (hide_poly.
contains(
true) || face_sets.is_empty()) {
1021 for (
const int i :
hide.index_range()) {
1022 hide[i] = face_sets[
faces[i]] != active_face_set;
1029 if (face_sets.is_empty()) {
1035 for (
const int i :
hide.index_range()) {
1036 if (face_sets[
faces[i]] == active_face_set) {
1044 if (face_sets.is_empty()) {
1053 for (
const int i :
hide.index_range()) {
1054 if (face_sets[
faces[i]] == active_face_set) {
1067 if (std::holds_alternative<std::monostate>(ss.
active_vert())) {
1112 ot->name =
"Face Sets Visibility";
1113 ot->idname =
"SCULPT_OT_face_set_change_visibility";
1114 ot->description =
"Change the visibility of the Face Sets of the sculpt";
1126 "Toggle Visibility",
1127 "Hide all Face Sets except for the active one"},
1131 "Show Active Face Set",
1132 "Show Active Face Set"},
1136 "Hide Active Face Sets",
1137 "Hide Active Face Sets"},
1138 {0,
nullptr, 0,
nullptr,
nullptr},
1163 if (!attributes.
contains(
".sculpt_face_set")) {
1171 mesh->face_sets_color_default = face_sets[random_index];
1173 mesh->face_sets_color_seed += 1;
1186 ot->name =
"Randomize Face Sets Colors";
1187 ot->idname =
"SCULPT_OT_face_sets_randomize_colors";
1188 ot->description =
"Generates a new set of random colors to render the Face Sets in the viewport";
1208 const int active_face_set_id,
1209 const bool modify_hidden,
1230 for (
const int i :
indices.index_range()) {
1232 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face]) {
1236 for (
const int vert : corner_verts.
slice(
faces[face])) {
1237 for (
const int neighbor_face_index : vert_to_face_map[vert]) {
1238 if (neighbor_face_index == face) {
1241 if (prev_face_sets[neighbor_face_index] == active_face_set_id) {
1242 face_sets[i] = active_face_set_id;
1248 if (prev_face_sets[face] == active_face_set_id) {
1249 for (
const int vert_i : corner_verts.
slice(
faces[face])) {
1250 for (
const int neighbor_face_index : vert_to_face_map[vert_i]) {
1251 if (neighbor_face_index == face) {
1254 if (prev_face_sets[neighbor_face_index] != active_face_set_id) {
1255 face_sets[i] = prev_face_sets[neighbor_face_index];
1269 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1275 if (face_sets.is_empty()) {
1279 if (check_visible_only) {
1280 for (
const int i : face_sets.index_range()) {
1281 if (!hide_poly.
is_empty() && hide_poly[i]) {
1284 first_face_set = face_sets[i];
1289 first_face_set = face_sets[0];
1296 for (
const int i : face_sets.index_range()) {
1297 if (check_visible_only && !hide_poly.
is_empty() && hide_poly[i]) {
1300 if (face_sets[i] != first_face_set) {
1332 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face_index]) {
1350 const int active_face_set_id,
1352 const float strength)
1372 if (!
vert_has_face_set(vert_to_face_map, face_sets, vert, active_face_set_id)) {
1378 fair_verts[vert] =
true;
1398 for (
const int i :
verts.index_range()) {
1399 translations[i] = new_positions[
verts[i]] - positions[
verts[i]];
1409 const bool modify_hidden)
1445 if (!attributes.
contains(
".sculpt_face_set")) {
1530 const int active_face_set =
RNA_int_get(op->
ptr,
"active_face_set");
1581 ot->name =
"Edit Face Set";
1582 ot->idname =
"SCULPT_OT_face_set_edit";
1583 ot->description =
"Edits the current active Face Set";
1592 ot->srna,
"active_face_set", 1, 0, INT_MAX,
"Active Face Set",
"", 0, 64);
1600 "Grows the Face Sets boundary by one face based on mesh topology"},
1605 "Shrinks the Face Sets boundary by one face based on mesh topology"},
1610 "Deletes the faces that are assigned to the Face Set"},
1615 "Creates a smooth as possible geometry patch from the Face Set minimizing changes in "
1616 "vertex positions"},
1621 "Creates a smooth as possible geometry patch from the Face Set minimizing changes in "
1623 {0,
nullptr, 0,
nullptr,
nullptr},
1626 RNA_def_float(
ot->srna,
"strength", 1.0f, 0.0f, 1.0f,
"Strength",
"", 0.0f, 1.0f);
1632 "Apply the edit operation to hidden geometry");
1684 bool any_updated =
false;
1686 if (!hide_poly.
is_empty() && hide_poly[face]) {
1695 face_sets.span[face] = new_face_set;
1699 node_changed[i] =
true;
1706 TLS &tls = all_tls.
local();
1711 bool any_updated =
false;
1712 for (
const int face : node_faces) {
1713 if (!hide_poly.
is_empty() && hide_poly[face]) {
1722 face_sets.span[face] = new_face_set;
1726 node_changed[i] =
true;
1752 bool any_updated =
false;
1767 node_changed[i] =
true;
1801 MEM_cnew<FaceSetOperation>(__func__));
1826 if (!gesture_data) {
1848 if (!gesture_data) {
1870 if (!gesture_data) {
1892 if (!gesture_data) {
1902 ot->name =
"Face Set Lasso Gesture";
1903 ot->idname =
"SCULPT_OT_face_set_polyline_gesture";
1904 ot->description =
"Add a face set in a shape defined by the cursor";
1920 ot->name =
"Face Set Box Gesture";
1921 ot->idname =
"SCULPT_OT_face_set_box_gesture";
1922 ot->description =
"Add a face set in a rectangle defined by the cursor";
1938 ot->name =
"Face Set Lasso Gesture";
1939 ot->idname =
"SCULPT_OT_face_set_lasso_gesture";
1940 ot->description =
"Add a face set in a shape defined by the cursor";
1956 ot->name =
"Face Set Line Gesture";
1957 ot->idname =
"SCULPT_OT_face_set_line_gesture";
1958 ot->description =
"Add a face set to one side of a line defined by the cursor";
int CCG_grid_xy_to_index(const int grid_size, const int x, const int y)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Base * CTX_data_active_base(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
bool BKE_base_is_visible(const View3D *v3d, const Base *base)
void BKE_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
@ BKE_MESH_BATCH_DIRTY_ALL
@ MESH_FAIRING_DEPTH_POSITION
@ MESH_FAIRING_DEPTH_TANGENCY
void BKE_mesh_prefair_and_fair_verts(Mesh *mesh, blender::MutableSpan< blender::float3 > deform_vert_positions, const bool affected_verts[], eMeshFairingDepth depth)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_original_mesh(const Object *object)
#define SCULPT_FACE_SET_NONE
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
void BKE_sculptsession_free_pbvh(Object &object)
A BVH for high poly meshes.
const blender::Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces(blender::bke::pbvh::BMeshNode *node)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
#define BLI_assert_unreachable()
BLI_INLINE float BLI_hash_int_01(unsigned int k)
MINLINE int max_ii(int a, int b)
MINLINE int clamp_i(int value, int min, int max)
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define POINTER_OFFSET(v, ofs)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color attribute
@ OPTYPE_DEPENDS_ON_CURSOR
#define BM_ELEM_CD_SET_INT(ele, offset, f)
void BM_mesh_delete_hflag_context(BMesh *bm, const char hflag, const int type)
#define BM_elem_index_get(ele)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_table_init(BMesh *bm, const char htype)
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
#define BMALLOC_TEMPLATE_FROM_ME(...)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
BPy_StructRNA * depsgraph
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
MutableSpan< T > as_mutable_span()
static IndexMask from_bools(Span< bool > bools, IndexMaskMemory &memory)
constexpr int64_t size() const
constexpr void fill(const T &value) const
constexpr Span< T > as_span() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr int64_t size() const
constexpr const T * end() const
constexpr IndexRange index_range() const
constexpr const T * begin() const
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
static VArray ForSingle(T value, const int64_t size)
GAttributeReader lookup(const StringRef attribute_id) const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
bool contains(const StringRef attribute_id) const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef attribute_id)
bool add(const StringRef attribute_id, const AttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_for_write_span(StringRef attribute_id)
void tag_positions_changed(const IndexMask &node_mask)
Span< NodeT > nodes() const
void tag_face_sets_changed(const IndexMask &node_mask)
void tag_visibility_changed(const IndexMask &node_mask)
int64_t min_array_size() const
void foreach_index(Fn &&fn) const
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void copy(const GVArray &src, GMutableSpan dst, int64_t grain_size=4096)
bool indexed_data_equal(const Span< T > all_values, const Span< int > indices, const Span< T > values)
BooleanMix booleans_mix_calc(const VArray< bool > &varray, IndexRange range_to_check)
IndexRange face_range(const OffsetIndices< int > faces, const int grid_area, const int face)
float3 face_normal_calc(Span< float3 > vert_positions, Span< int > face_verts)
GroupedSpan< int > build_edge_to_face_map(OffsetIndices< int > faces, Span< int > corner_edges, int edges_num, Array< int > &r_offsets, Array< int > &r_indices)
float3 face_center_calc(Span< float3 > vert_positions, Span< int > face_verts)
pbvh::Tree * pbvh_get(Object &object)
void update_bounds(const Depsgraph &depsgraph, const Object &object, Tree &pbvh)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
void update_visibility(const Object &object, Tree &pbvh)
Span< int > node_face_indices_calc_grids(const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
bool vert_is_boundary(const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary, const int vert)
void ensure_boundary_info(Object &object)
static int gesture_lasso_exec(bContext *C, wmOperator *op)
static void face_hide_update(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const FunctionRef< void(Span< int >, MutableSpan< bool >)> calc_hide)
static bool edit_is_operation_valid(const Object &object, const EditMode mode, const bool modify_hidden)
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)
int find_next_available_id(Object &object)
int ensure_face_sets_bmesh(Object &object)
static void gesture_apply_for_symmetry_pass(bContext &, gesture::GestureData &gesture_data)
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 int change_visibility_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool vert_has_unique_face_set(const GroupedSpan< int > vert_to_face_map, const Span< int > face_sets, 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)
void SCULPT_OT_face_set_lasso_gesture(wmOperatorType *ot)
static int gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void gesture_begin(bContext &C, wmOperator &op, gesture::GestureData &gesture_data)
bool create_face_sets_mesh(Object &object)
static int gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void initialize_none_to_id(Mesh *mesh, int new_id)
static bool edit_op_init(bContext *C, wmOperator *op)
void SCULPT_OT_face_set_line_gesture(wmOperatorType *ot)
void SCULPT_OT_face_set_polyline_gesture(wmOperatorType *ot)
static void clear_face_sets(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
static void delete_geometry(Object &ob, const int active_face_set_id, const bool modify_hidden)
void SCULPT_OT_face_sets_init(wmOperatorType *ot)
int active_update_and_get(bContext *C, Object &ob, const float mval_fl[2])
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)
void filter_verts_with_unique_face_sets_bmesh(int face_set_offset, const bool unique, const Set< BMVert *, 0 > &verts, const MutableSpan< float > factors)
static void show_all(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
Array< int > duplicate_face_sets(const Mesh &mesh)
FunctionRef< bool(int from_face, int edge, int to_face)> FaceSetsFloodFillFn
void SCULPT_OT_face_sets_create(wmOperatorType *ot)
Set< int > gather_hidden_face_sets(const Span< bool > hide_poly, const Span< int > face_sets)
static int create_op_exec(bContext *C, wmOperator *op)
static void gesture_apply_mesh(gesture::GestureData &gesture_data, const IndexMask &node_mask)
void SCULPT_OT_face_set_change_visibility(wmOperatorType *ot)
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)
static int init_op_exec(bContext *C, wmOperator *op)
void SCULPT_OT_face_sets_randomize_colors(wmOperatorType *ot)
static bool check_single_face_set(const Object &object, const bool check_visible_only)
static int edit_op_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int edit_op_exec(bContext *C, wmOperator *op)
static int gesture_box_exec(bContext *C, wmOperator *op)
bke::SpanAttributeWriter< int > ensure_face_sets_mesh(Mesh &mesh)
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 int change_visibility_exec(bContext *C, wmOperator *op)
void SCULPT_OT_face_sets_edit(wmOperatorType *ot)
static void gesture_end(bContext &, gesture::GestureData &gesture_data)
static void gesture_apply_bmesh(gesture::GestureData &gesture_data, const IndexMask &node_mask)
static void init_operation(gesture::GestureData &gesture_data, wmOperator &)
void SCULPT_OT_face_set_box_gesture(wmOperatorType *ot)
static int randomize_colors_exec(bContext *C, wmOperator *)
static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void edit_modify_coordinates(bContext *C, Object &ob, const int active_face_set, const EditMode mode, wmOperator *op)
static void init_flood_fill(Object &ob, const FaceSetsFloodFillFn &test_fn)
static int gesture_line_exec(bContext *C, wmOperator *op)
int active_face_set_get(const Object &object)
static int gesture_polyline_exec(bContext *C, wmOperator *op)
static void edit_modify_geometry(bContext *C, Object &ob, const int active_face_set, const bool modify_hidden, wmOperator *op)
std::unique_ptr< GestureData > init_from_box(bContext *C, wmOperator *op)
void operator_properties(wmOperatorType *ot, ShapeType shapeType)
std::unique_ptr< GestureData > init_from_polyline(bContext *C, wmOperator *op)
std::unique_ptr< GestureData > init_from_line(bContext *C, wmOperator *op)
void apply(bContext &C, GestureData &gesture_data, wmOperator &op)
std::unique_ptr< GestureData > init_from_lasso(bContext *C, wmOperator *op)
bool is_affected(const GestureData &gesture_data, const float3 &position, const float3 &normal)
void tag_update_visibility(const bContext &C)
void grids_show_all(Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
void mesh_show_all(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask)
void sync_all_from_faces(Object &object)
void invalidate(SculptSession &ss)
void push_end(Object &ob)
void push_nodes(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const Type type)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, Type type)
void geometry_begin(const Scene &scene, Object &ob, const wmOperator *op)
void geometry_end(Object &ob)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
void flush_update_done(const bContext *C, Object &ob, UpdateType update_type)
void scale_translations(MutableSpan< float3 > translations, Span< float > factors)
void flush_update_step(bContext *C, UpdateType update_type)
void clip_and_lock_translations(const Sculpt &sd, const SculptSession &ss, Span< float3 > positions, Span< int > verts, MutableSpan< float3 > translations)
void scatter_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
void gather_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
VecBase< float, 3 > float3
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
bool SCULPT_cursor_geometry_info_update(bContext *C, SculptCursorGeometryInfo *out, const float mval[2], bool use_sampled_normal)
void SCULPT_vertex_random_access_ensure(Object &object)
bool SCULPT_mode_poll_view3d(bContext *C)
bool SCULPT_mode_poll(bContext *C)
void SCULPT_tag_update_overlays(bContext *C)
struct SculptSession * sculpt
SculptVertexInfo vertex_info
ActiveVert active_vert() const
blender::Array< int > edge_to_face_offsets
blender::float3 active_vert_position(const Depsgraph &depsgraph, const Object &object) const
blender::GroupedSpan< int > edge_to_face_map
blender::Array< int > edge_to_face_indices
blender::BitVector boundary
blender::Array< float > masks
float average_stroke_accum[3]
int average_stroke_counter
MutableVArraySpan< T > span
Vector< float3 > translations
void(* end)(bContext &, GestureData &)
void(* begin)(bContext &, wmOperator &, GestureData &)
void(* apply_for_symmetry_pass)(bContext &, GestureData &)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
void WM_operator_properties_border(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_polyline(wmOperatorType *ot)