91 for (const int id : face_sets.slice(range)) {
92 max = std::max(max, id);
96 [](
const int a,
const int b) {
return std::max(a,
b); });
103 if (cd_offset == -1) {
107 int next_face_set = 1;
112 next_face_set = std::max(next_face_set, fset);
115 return next_face_set + 1;
131 for (
const int i : face_sets.
span.index_range()) {
133 face_sets.
span[
i] = new_id;
157 if (attributes.
contains(
".sculpt_face_set")) {
160 attributes.
add<
int>(
".sculpt_face_set",
163 mesh.face_sets_color_default = 1;
170 if (!attributes.
contains(
".sculpt_face_set")) {
171 attributes.
add<
int>(
".sculpt_face_set",
174 mesh.face_sets_color_default = 1;
195 mesh.face_sets_color_default = 1;
219 for (
const int i :
verts.index_range()) {
243 const int node_vert = node_start + offset;
244 if (factors[node_vert] == 0.0f) {
253 faces, corner_verts, vert_to_face_map, face_sets, subdiv_ccg, coord))
255 factors[node_vert] = 0.0f;
307 TLS &tls = all_tls.
local();
310 tls.new_face_sets.resize(
faces.size());
313 calc_face_sets(
faces, new_face_sets);
320 node_changed[
i] =
true;
326 TLS &tls = all_tls.
local();
330 tls.new_face_sets.resize(
faces.size());
333 calc_face_sets(
faces, new_face_sets);
340 node_changed[
i] =
true;
360 if (!attributes.
contains(
".sculpt_face_set")) {
368 const int default_face_set =
mesh.face_sets_color_default;
374 if (std::any_of(
faces.begin(),
faces.end(), [&](
const int face) {
375 return face_sets[face] != default_face_set;
379 node_changed[
i] =
true;
390 if (std::any_of(
faces.begin(),
faces.end(), [&](
const int face) {
391 return face_sets[face] != default_face_set;
395 node_changed[
i] =
true;
401 attributes.
remove(
".sculpt_face_set");
444 if (!
mask.is_empty()) {
449 for (
const int i :
indices.index_range()) {
454 if (!std::any_of(face_verts.
begin(),
456 [&](
const int vert) { return mask[vert] > 0.5f; }))
460 face_sets[
i] = next_face_set;
469 const int grid_area = subdiv_ccg.
grid_area;
473 if (!masks.is_empty()) {
478 for (
const int i :
indices.index_range()) {
485 if (!std::any_of(face_masks.
begin(),
487 [&](
const float mask) { return mask > 0.5f; }))
491 face_sets[
i] = next_face_set;
515 for (
const int i :
indices.index_range()) {
517 face_sets[
i] = next_face_set;
530 face_sets.
fill(next_face_set);
542 for (
const int i :
indices.index_range()) {
544 if (!hide_poly.is_empty() && hide_poly[
i]) {
547 face_sets[
i] = next_face_set;
565 ot->name =
"Create Face Set";
566 ot->idname =
"SCULPT_OT_face_sets_create";
567 ot->description =
"Create a new Face Set";
578 "Face Set from Masked",
579 "Create a new Face Set from the masked faces"},
583 "Face Set from Visible",
584 "Create a new Face Set from the visible vertices"},
588 "Face Set Full Mesh",
589 "Create an unique Face Set with all faces in the sculpt"},
593 "Face Set from Edit Mode Selection",
594 "Create an Face Set corresponding to the Edit Mode face selection"},
595 {0,
nullptr, 0,
nullptr,
nullptr},
635 int next_face_set = 1;
637 for (
const int i :
faces.index_range()) {
638 if (!hide_poly.
is_empty() && hide_poly[
i]) {
641 if (visited_faces[
i]) {
644 std::queue<int> queue;
646 while (hidden_face_sets.contains(next_face_set)) {
649 face_sets.
span[
i] = next_face_set;
650 visited_faces[
i].set(
true);
653 while (!queue.empty()) {
654 const int face_i = queue.front();
657 for (
const int edge_i : corner_edges.
slice(
faces[face_i])) {
659 if (neighbor_i == face_i) {
662 if (visited_faces[neighbor_i]) {
665 if (!hide_poly.
is_empty() && hide_poly[neighbor_i]) {
668 if (!test_fn(face_i, edge_i, neighbor_i)) {
672 face_sets.
span[neighbor_i] = next_face_set;
673 visited_faces[neighbor_i].set(
true);
674 queue.push(neighbor_i);
694 hidden_face_sets.
add(face_sets[
i]);
698 return hidden_face_sets;
741 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) {
742 return hide_poly[from_face] == hide_poly[to_face];
753 if (!hide_poly.is_empty() && hide_poly[
i]) {
759 face_sets.
span[
i] = material_indices[
i] + 1;
767 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
768 return std::abs(
math::dot(face_normals[from_face], face_normals[to_face])) > threshold;
776 [&](
const int ,
const int edge,
const int ) ->
bool {
777 return !uv_seams[edge];
785 [&](
const int ,
const int edge,
const int ) ->
bool {
786 return creases[edge] < threshold;
794 [&](
const int ,
const int edge,
const int ) ->
bool {
795 return !sharp_edges[edge];
803 [&](
const int ,
const int edge,
const int ) ->
bool {
804 return bevel_weights[edge] < threshold;
810 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
811 return face_sets_copy[from_face] == face_sets_copy[to_face];
828 ot->name =
"Init Face Sets";
829 ot->idname =
"SCULPT_OT_face_sets_init";
830 ot->description =
"Initializes all Face Sets in the mesh";
841 "Face Sets from Loose Parts",
842 "Create a Face Set per loose part in the mesh"},
846 "Face Sets from Material Slots",
847 "Create a Face Set per Material Slot"},
851 "Face Sets from Mesh Normals",
852 "Create Face Sets for Faces that have similar normal"},
856 "Face Sets from UV Seams",
857 "Create Face Sets using UV Seams as boundaries"},
861 "Face Sets from Edge Creases",
862 "Create Face Sets using Edge Creases as boundaries"},
866 "Face Sets from Bevel Weight",
867 "Create Face Sets using Bevel Weights as boundaries"},
871 "Face Sets from Sharp Edges",
872 "Create Face Sets using Sharp Edges as boundaries"},
874 "FACE_SET_BOUNDARIES",
876 "Face Sets from Face Set Boundaries",
877 "Create a Face Set per isolated Face Set"},
878 {0,
nullptr, 0,
nullptr,
nullptr},
888 "Minimum value to consider a certain attribute a boundary when creating the Face Sets",
922 TLS &tls = all_tls.
local();
925 tls.new_hide.resize(
faces.size());
928 calc_hide(
faces, new_hide);
935 node_changed[
i] =
true;
941 TLS &tls = all_tls.
local();
945 tls.new_hide.resize(
faces.size());
948 calc_hide(
faces, new_hide);
955 node_changed[
i] =
true;
1017 if (hide_poly.
contains(
true) || face_sets.is_empty()) {
1023 for (
const int i :
hide.index_range()) {
1031 if (face_sets.is_empty()) {
1037 for (
const int i :
hide.index_range()) {
1038 if (face_sets[
faces[
i]] == active_face_set) {
1046 if (face_sets.is_empty()) {
1055 for (
const int i :
hide.index_range()) {
1056 if (face_sets[
faces[
i]] == active_face_set) {
1070 if (std::holds_alternative<std::monostate>(ss.
active_vert())) {
1115 ot->name =
"Face Sets Visibility";
1116 ot->idname =
"SCULPT_OT_face_set_change_visibility";
1117 ot->description =
"Change the visibility of the Face Sets of the sculpt";
1129 "Toggle Visibility",
1130 "Hide all Face Sets except for the active one"},
1134 "Show Active Face Set",
1135 "Show Active Face Set"},
1139 "Hide Active Face Sets",
1140 "Hide Active Face Sets"},
1141 {0,
nullptr, 0,
nullptr,
nullptr},
1166 if (!attributes.
contains(
".sculpt_face_set")) {
1174 mesh->face_sets_color_default = face_sets[random_index];
1176 mesh->face_sets_color_seed += 1;
1189 ot->name =
"Randomize Face Sets Colors";
1190 ot->idname =
"SCULPT_OT_face_sets_randomize_colors";
1191 ot->description =
"Generates a new set of random colors to render the Face Sets in the viewport";
1211 const int active_face_set_id,
1212 const bool modify_hidden,
1233 for (
const int i :
indices.index_range()) {
1235 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face]) {
1239 for (
const int vert : corner_verts.
slice(
faces[face])) {
1240 for (
const int neighbor_face_index : vert_to_face_map[vert]) {
1241 if (neighbor_face_index == face) {
1244 if (prev_face_sets[neighbor_face_index] == active_face_set_id) {
1245 face_sets[
i] = active_face_set_id;
1251 if (prev_face_sets[face] == active_face_set_id) {
1252 for (
const int vert_i : corner_verts.
slice(
faces[face])) {
1253 for (
const int neighbor_face_index : vert_to_face_map[vert_i]) {
1254 if (neighbor_face_index == face) {
1257 if (prev_face_sets[neighbor_face_index] != active_face_set_id) {
1258 face_sets[
i] = prev_face_sets[neighbor_face_index];
1272 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1278 if (face_sets.is_empty()) {
1282 if (check_visible_only) {
1283 for (
const int i : face_sets.index_range()) {
1284 if (!hide_poly.
is_empty() && hide_poly[
i]) {
1287 first_face_set = face_sets[
i];
1292 first_face_set = face_sets[0];
1299 for (
const int i : face_sets.index_range()) {
1300 if (check_visible_only && !hide_poly.
is_empty() && hide_poly[
i]) {
1303 if (face_sets[
i] != first_face_set) {
1335 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face_index]) {
1353 const int active_face_set_id,
1355 const float strength)
1375 if (!
vert_has_face_set(vert_to_face_map, face_sets, vert, active_face_set_id)) {
1381 fair_verts[vert] =
true;
1397 LocalData &tls = all_tls.local();
1399 tls.translations.resize(
verts.size());
1401 for (
const int i :
verts.index_range()) {
1402 translations[
i] = new_positions[
verts[
i]] - positions[
verts[
i]];
1406 position_data.deform(translations,
verts);
1412 const bool modify_hidden)
1448 if (!attributes.
contains(
".sculpt_face_set")) {
1532 const int active_face_set =
RNA_int_get(op->
ptr,
"active_face_set");
1583 ot->name =
"Edit Face Set";
1584 ot->idname =
"SCULPT_OT_face_set_edit";
1585 ot->description =
"Edits the current active Face Set";
1594 ot->srna,
"active_face_set", 1, 0, INT_MAX,
"Active Face Set",
"", 0, 64);
1602 "Grows the Face Sets boundary by one face based on mesh topology"},
1607 "Shrinks the Face Sets boundary by one face based on mesh topology"},
1612 "Deletes the faces that are assigned to the Face Set"},
1617 "Creates a smooth as possible geometry patch from the Face Set minimizing changes in "
1618 "vertex positions"},
1623 "Creates a smooth as possible geometry patch from the Face Set minimizing changes in "
1625 {0,
nullptr, 0,
nullptr,
nullptr},
1628 prop =
RNA_def_float(
ot->srna,
"strength", 1.0f, 0.0f, 1.0f,
"Strength",
"", 0.0f, 1.0f);
1635 "Apply the edit operation to hidden geometry");
1687 bool any_updated =
false;
1689 if (!hide_poly.
is_empty() && hide_poly[face]) {
1698 face_sets.span[face] = new_face_set;
1702 node_changed[
i] =
true;
1709 TLS &tls = all_tls.
local();
1714 bool any_updated =
false;
1715 for (
const int face : node_faces) {
1716 if (!hide_poly.
is_empty() && hide_poly[face]) {
1725 face_sets.span[face] = new_face_set;
1729 node_changed[
i] =
true;
1753 bool any_updated =
false;
1768 node_changed[
i] =
true;
1827 if (!gesture_data) {
1849 if (!gesture_data) {
1871 if (!gesture_data) {
1893 if (!gesture_data) {
1903 ot->name =
"Face Set Lasso Gesture";
1904 ot->idname =
"SCULPT_OT_face_set_polyline_gesture";
1905 ot->description =
"Add a face set in a shape defined by the cursor";
1921 ot->name =
"Face Set Box Gesture";
1922 ot->idname =
"SCULPT_OT_face_set_box_gesture";
1923 ot->description =
"Add a face set in a rectangle defined by the cursor";
1939 ot->name =
"Face Set Lasso Gesture";
1940 ot->idname =
"SCULPT_OT_face_set_lasso_gesture";
1941 ot->description =
"Add a face set in a shape defined by the cursor";
1957 ot->name =
"Face Set Line Gesture";
1958 ot->idname =
"SCULPT_OT_face_set_line_gesture";
1959 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)
Paint * BKE_paint_get_active_from_context(const bContext *C)
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)
#define BLT_I18NCONTEXT_AMOUNT
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
@ 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 StringRef name)
#define BM_ITER_MESH(ele, iter, bm, itype)
BMesh const char void * data
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 from_single(T value, const int64_t size)
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
bool contains(StringRef attribute_id) const
GAttributeReader lookup(const StringRef attribute_id) const
bool add(const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef attribute_id)
GSpanAttributeWriter lookup_for_write_span(StringRef attribute_id)
void tag_positions_changed(const IndexMask &node_mask)
Span< NodeT > nodes() const
void update_bounds(const Depsgraph &depsgraph, const Object &object)
void tag_face_sets_changed(const IndexMask &node_mask)
void tag_visibility_changed(const IndexMask &node_mask)
void update_visibility(const Object &object)
int64_t min_array_size() const
void foreach_index(Fn &&fn) const
void * MEM_callocN(size_t len, const char *str)
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)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
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 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 wmOperatorStatus init_op_exec(bContext *C, wmOperator *op)
static wmOperatorStatus gesture_box_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus gesture_line_exec(bContext *C, wmOperator *op)
static wmOperatorStatus change_visibility_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 void gesture_begin(bContext &C, wmOperator &op, gesture::GestureData &gesture_data)
bool create_face_sets_mesh(Object &object)
void initialize_none_to_id(Mesh *mesh, int new_id)
static bool edit_op_init(bContext *C, wmOperator *op)
static wmOperatorStatus randomize_colors_exec(bContext *C, wmOperator *)
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)
static wmOperatorStatus change_visibility_exec(bContext *C, wmOperator *op)
void SCULPT_OT_face_sets_init(wmOperatorType *ot)
int active_update_and_get(bContext *C, Object &ob, const float mval_fl[2])
static wmOperatorStatus gesture_lasso_exec(bContext *C, wmOperator *op)
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 wmOperatorStatus edit_op_exec(bContext *C, 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)
static wmOperatorStatus gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 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)
void SCULPT_OT_face_sets_randomize_colors(wmOperatorType *ot)
static bool check_single_face_set(const Object &object, const bool check_visible_only)
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 wmOperatorStatus gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
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 wmOperatorStatus create_op_exec(bContext *C, wmOperator *op)
static void init_operation(gesture::GestureData &gesture_data, wmOperator &)
static wmOperatorStatus edit_op_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_face_set_box_gesture(wmOperatorType *ot)
static void edit_modify_coordinates(bContext *C, Object &ob, const int active_face_set, const EditMode mode, wmOperator *op)
static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op)
static void init_flood_fill(Object &ob, const FaceSetsFloodFillFn &test_fn)
static wmOperatorStatus gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int active_face_set_get(const Object &object)
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, const 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 geometry_begin(const Scene &scene, Object &ob, const wmOperator *op)
void geometry_end(Object &ob)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, const Type type)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
void vert_random_access_ensure(Object &object)
void scale_translations(MutableSpan< float3 > translations, Span< float > factors)
void clip_and_lock_translations(const Sculpt &sd, const SculptSession &ss, Span< float3 > positions, Span< int > verts, MutableSpan< float3 > translations)
bool cursor_geometry_info_update(bContext *C, CursorGeometryInfo *out, const float2 &mval, const bool use_sampled_normal)
void flush_update_done(const bContext *C, Object &ob, const UpdateType update_type)
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)
void flush_update_step(const bContext *C, const UpdateType update_type)
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_translation_context(PropertyRNA *prop, const char *context)
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_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
blender::float3 average_stroke_accum
int average_stroke_counter
MutableVArraySpan< T > span
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)
wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_straightline_oneshot_modal(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)