87 for (const int id : face_sets.slice(range)) {
88 max = std::max(max, id);
92 [](
const int a,
const int b) {
return std::max(a,
b); });
109 if (cd_offset == -1) {
113 int next_face_set = 1;
118 next_face_set = std::max(next_face_set, fset);
121 return next_face_set + 1;
137 for (
const int i : face_sets.
span.index_range()) {
138 if (face_sets.
span[i] == face_set_none_id) {
139 face_sets.
span[i] = new_id;
148 return face_set_none_id;
152 return face_set_none_id;
162 if (attributes.
contains(
".sculpt_face_set")) {
166 mesh.face_sets_color_default = 1;
173 if (!attributes.
contains(
".sculpt_face_set")) {
175 mesh.face_sets_color_default = 1;
196 mesh.face_sets_color_default = 1;
242 const int node_start = i * key.
grid_area;
246 const int node_vert = node_start + offset;
247 if (factors[node_vert] == 0.0f) {
256 faces, corner_verts, vert_to_face_map, face_sets, subdiv_ccg, coord))
258 factors[node_vert] = 0.0f;
274 for (
const BMVert *vert : verts) {
311 TLS &tls = all_tls.
local();
314 tls.new_face_sets.resize(faces.
size());
317 calc_face_sets(faces, new_face_sets);
324 node_changed[i] =
true;
332 TLS &tls = all_tls.
local();
336 tls.new_face_sets.resize(faces.
size());
339 calc_face_sets(faces, new_face_sets);
346 node_changed[i] =
true;
367 if (!attributes.
contains(
".sculpt_face_set")) {
375 const int default_face_set =
mesh.face_sets_color_default;
382 if (std::any_of(faces.
begin(),
384 [&](
const int face) { return face_sets[face] != default_face_set; }))
387 node_changed[i] =
true;
400 if (std::any_of(faces.
begin(),
402 [&](
const int face) { return face_sets[face] != default_face_set; }))
405 node_changed[i] =
true;
412 attributes.
remove(
".sculpt_face_set");
457 if (!
mask.is_empty()) {
463 if (!hide_poly.
is_empty() && hide_poly[indices[i]]) {
466 const Span<int> face_verts = corner_verts.
slice(faces[indices[i]]);
467 if (!std::any_of(face_verts.
begin(),
469 [&](
const int vert) { return mask[vert] > 0.5f; }))
473 face_sets[i] = next_face_set;
482 const int grid_area = subdiv_ccg.
grid_area;
486 if (!masks.is_empty()) {
492 if (!hide_poly.
is_empty() && hide_poly[indices[i]]) {
498 if (!std::any_of(face_masks.
begin(),
500 [&](
const float mask) { return mask > 0.5f; }))
504 face_sets[i] = next_face_set;
529 if (!hide_poly_span[indices[i]]) {
530 face_sets[i] = next_face_set;
543 face_sets.
fill(next_face_set);
556 if (select_poly[indices[i]]) {
557 if (!hide_poly.is_empty() && hide_poly[indices[i]]) {
560 face_sets[i] = next_face_set;
578 ot->
name =
"Create Face Set";
579 ot->
idname =
"SCULPT_OT_face_sets_create";
591 "Face Set from Masked",
592 "Create a new face set from the masked faces"},
596 "Face Set from Visible",
597 "Create a new face set from the visible vertices"},
601 "Face Set Full Mesh",
602 "Create a unique face set with all faces in the sculpt"},
606 "Face Set from Edit Mode Selection",
607 "Create a face set corresponding to the Edit Mode face selection"},
608 {0,
nullptr, 0,
nullptr,
nullptr},
648 int next_face_set = 1;
651 if (!hide_poly.
is_empty() && hide_poly[i]) {
654 if (visited_faces[i]) {
657 std::queue<int> queue;
659 while (hidden_face_sets.contains(next_face_set)) {
662 face_sets.
span[i] = next_face_set;
663 visited_faces[i].set(
true);
666 while (!queue.empty()) {
667 const int face_i = queue.front();
670 for (
const int edge_i : corner_edges.
slice(faces[face_i])) {
672 if (neighbor_i == face_i) {
675 if (visited_faces[neighbor_i]) {
678 if (!hide_poly.
is_empty() && hide_poly[neighbor_i]) {
681 if (!test_fn(face_i, edge_i, neighbor_i)) {
685 face_sets.
span[neighbor_i] = next_face_set;
686 visited_faces[neighbor_i].set(
true);
687 queue.push(neighbor_i);
707 hidden_face_sets.
add(face_sets[i]);
711 return hidden_face_sets;
756 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) {
757 return hide_poly[from_face] == hide_poly[to_face];
768 if (!hide_poly.is_empty() && hide_poly[i]) {
774 face_sets.
span[i] = material_indices[i] + 1;
782 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
783 return std::abs(
math::dot(face_normals[from_face], face_normals[to_face])) > threshold;
791 [&](
const int ,
const int edge,
const int ) ->
bool {
792 return !uv_seams[edge];
800 [&](
const int ,
const int edge,
const int ) ->
bool {
801 return creases[edge] < threshold;
809 [&](
const int ,
const int edge,
const int ) ->
bool {
810 return !sharp_edges[edge];
818 [&](
const int ,
const int edge,
const int ) ->
bool {
819 return bevel_weights[edge] < threshold;
825 init_flood_fill(ob, [&](
const int from_face,
const int ,
const int to_face) ->
bool {
826 return face_sets_copy[from_face] == face_sets_copy[to_face];
834 pbvh.tag_face_sets_changed(node_mask);
843 ot->
name =
"Init Face Sets";
844 ot->
idname =
"SCULPT_OT_face_sets_init";
845 ot->
description =
"Initializes all face sets in the mesh";
856 "Face Sets from Loose Parts",
857 "Create a face set per loose part in the mesh"},
861 "Face Sets from Material Slots",
862 "Create a face set per material slot"},
866 "Face Sets from Mesh Normals",
867 "Create face sets for faces that have similar normal"},
871 "Face Sets from UV Seams",
872 "Create face sets using UV seams as boundaries"},
876 "Face Sets from Edge Creases",
877 "Create face sets using edge creases as boundaries"},
881 "Face Sets from Bevel Weight",
882 "Create face sets using bevel weights as boundaries"},
886 "Face Sets from Sharp Edges",
887 "Create face sets using sharp edges as boundaries"},
889 "FACE_SET_BOUNDARIES",
891 "Face Sets from Face Set Boundaries",
892 "Create a face set per isolated face set"},
893 {0,
nullptr, 0,
nullptr,
nullptr},
903 "Minimum value to consider a certain attribute a boundary when creating the face sets",
938 TLS &tls = all_tls.
local();
941 tls.new_hide.resize(faces.
size());
944 calc_hide(faces, new_hide);
951 node_changed[i] =
true;
959 TLS &tls = all_tls.
local();
963 tls.new_hide.resize(faces.
size());
966 calc_hide(faces, new_hide);
973 node_changed[i] =
true;
986 pbvh.tag_visibility_changed(node_mask);
1022 const int active_face_set =
RNA_int_get(op->
ptr,
"active_face_set");
1036 if (hide_poly.
contains(
true) || face_sets.is_empty()) {
1037 show_all(depsgraph,
object, node_mask);
1042 for (
const int i :
hide.index_range()) {
1043 hide[i] = face_sets[faces[i]] != active_face_set;
1050 if (face_sets.is_empty()) {
1051 show_all(depsgraph,
object, node_mask);
1056 for (
const int i :
hide.index_range()) {
1057 if (face_sets[faces[i]] == active_face_set) {
1065 if (face_sets.is_empty()) {
1074 for (
const int i :
hide.index_range()) {
1075 if (face_sets[faces[i]] == active_face_set) {
1089 if (std::holds_alternative<std::monostate>(ss.
active_vert())) {
1095 mul_m4_v3(
object.object_to_world().ptr(), location);
1102 pbvh.update_visibility(
object);
1134 ot->
name =
"Face Sets Visibility";
1135 ot->
idname =
"SCULPT_OT_face_set_change_visibility";
1136 ot->
description =
"Change the visibility of the face sets of the sculpt";
1148 "Toggle Visibility",
1149 "Hide all face sets except for the active one"},
1153 "Show Active Face Set",
1154 "Show the active face set"},
1158 "Hide Active Face Set",
1159 "Hide the active face set"},
1160 {0,
nullptr, 0,
nullptr,
nullptr},
1189 if (!attributes.
contains(
".sculpt_face_set")) {
1197 mesh->face_sets_color_default = face_sets[random_index];
1199 mesh->face_sets_color_seed += 1;
1203 pbvh.tag_face_sets_changed(node_mask);
1212 ot->
name =
"Randomize Face Sets Colors";
1213 ot->
idname =
"SCULPT_OT_face_sets_randomize_colors";
1214 ot->
description =
"Generates a new set of random colors to render the face sets in the viewport";
1234 const int active_face_set_id,
1235 const bool modify_hidden,
1257 const int face = indices[i];
1258 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face]) {
1262 for (
const int vert : corner_verts.
slice(faces[face])) {
1263 for (
const int neighbor_face_index : vert_to_face_map[vert]) {
1264 if (neighbor_face_index == face) {
1267 if (prev_face_sets[neighbor_face_index] == active_face_set_id) {
1268 face_sets[i] = active_face_set_id;
1274 if (prev_face_sets[face] == active_face_set_id) {
1275 for (
const int vert_i : corner_verts.
slice(faces[face])) {
1276 for (
const int neighbor_face_index : vert_to_face_map[vert_i]) {
1277 if (neighbor_face_index == face) {
1280 if (prev_face_sets[neighbor_face_index] != active_face_set_id) {
1281 face_sets[i] = prev_face_sets[neighbor_face_index];
1295 const Mesh &
mesh = *id_cast<const Mesh *>(
object.
data);
1301 if (face_sets.is_empty()) {
1304 int first_face_set = face_set_none_id;
1305 if (check_visible_only) {
1306 for (
const int i : face_sets.index_range()) {
1307 if (!hide_poly.
is_empty() && hide_poly[i]) {
1310 first_face_set = face_sets[i];
1315 first_face_set = face_sets[0];
1318 if (first_face_set == face_set_none_id) {
1322 for (
const int i : face_sets.index_range()) {
1323 if (check_visible_only && !hide_poly.
is_empty() && hide_poly[i]) {
1326 if (face_sets[i] != first_face_set) {
1358 if (!modify_hidden && !hide_poly.
is_empty() && hide_poly[face_index]) {
1376 const int active_face_set_id,
1378 const float strength)
1398 if (!
vert_has_face_set(vert_to_face_map, face_sets, vert, active_face_set_id)) {
1404 fair_verts[vert] =
true;
1421 LocalData &tls = all_tls.local();
1423 tls.translations.resize(verts.
size());
1426 translations[i] = new_positions[verts[i]] - positions[verts[i]];
1430 position_data.deform(translations, verts);
1437 const bool modify_hidden)
1473 if (!attributes.
contains(
".sculpt_face_set")) {
1524 pbvh.tag_positions_changed(node_mask);
1525 pbvh.update_bounds(depsgraph, ob);
1557 const int active_face_set =
RNA_int_get(op->
ptr,
"active_face_set");
1571 edit_grow_shrink(depsgraph, scene, ob, mode, active_face_set, modify_hidden, op);
1611 ot->
name =
"Edit Face Set";
1612 ot->
idname =
"SCULPT_OT_face_set_edit";
1613 ot->
description =
"Edits the current active face set";
1622 ot->
srna,
"active_face_set", 1, 0,
INT_MAX,
"Active Face Set",
"", 0, 64);
1630 "Grows the face set boundary by one face based on mesh topology"},
1635 "Shrinks the face set boundary by one face based on mesh topology"},
1640 "Deletes the faces that are assigned to the face set"},
1645 "Creates the smoothest possible geometry patch from the face set minimizing changes in "
1646 "vertex positions"},
1651 "Creates the smoothest possible geometry patch from the face set minimizing changes in "
1653 {0,
nullptr, 0,
nullptr,
nullptr},
1656 prop =
RNA_def_float(ot->
srna,
"strength", 1.0f, 0.0f, 1.0f,
"Strength",
"", 0.0f, 1.0f);
1663 "Apply the edit operation to hidden geometry");
1682 for (
BMFace *f : faces) {
1684 r_factors[i] = 0.0f;
1688 if (mask_offset == -1) {
1689 r_factors[i] = 1.0f;
1695 int total_verts = 0;
1701 }
while ((l_iter = l_iter->
next) != f->l_first);
1702 r_factors[i] = 1.0f - sum *
math::rcp(
float(total_verts));
1721 const Span<int> face_verts = corner_verts.
slice(faces[face_indices[i]]);
1724 for (
const int vert : face_verts) {
1727 r_factors[i] = 1.0f - sum * inv_size;
1731 r_factors.
fill(1.0f);
1737 if (span[face_indices[i]]) {
1738 r_factors[i] = 0.0f;
1754 corner_verts.
slice(faces[face_indices[i]]));
1763 for (
const BMFace *f : faces) {
1767 centers[i] = face_center;
1806 const Depsgraph &depsgraph = *gesture_data.
vc.
depsgraph;
1830 TLS &tls = all_tls.
local();
1832 bool any_updated =
false;
1836 tls.positions.resize(face_indices.
size());
1839 mesh.faces(), corner_verts, positions_eval, face_indices, face_centers);
1841 tls.factors.resize(face_indices.
size());
1846 for (
const int idx : face_indices.
index_range()) {
1851 const int face = face_indices[idx];
1858 face_sets.
span[face] = new_face_set;
1862 node_changed[i] =
true;
1871 TLS &tls = all_tls.
local();
1874 bool any_updated =
false;
1880 tls.factors.resize(positions.
size());
1885 tls.face_indices.resize(positions.
size());
1889 for (
const int idx : face_indices_grid.
index_range()) {
1894 const int face = face_indices_grid[idx];
1902 face_sets.
span[face] = new_face_set;
1906 node_changed[i] =
true;
1922 const Depsgraph &depsgraph = *gesture_data.
vc.
depsgraph;
1938 TLS &tls = all_tls.
local();
1941 bool any_updated =
false;
1945 tls.positions.resize(faces.
size());
1949 tls.factors.resize(faces.
size());
1955 for (
BMFace *face : faces) {
1969 node_changed[i] =
true;
1979 pbvh.tag_face_sets_changed(node_mask);
2030 if (!gesture_data) {
2053 if (!gesture_data) {
2076 if (!gesture_data) {
2099 if (!gesture_data) {
2110 ot->
name =
"Face Set Lasso Gesture";
2111 ot->
idname =
"SCULPT_OT_face_set_polyline_gesture";
2112 ot->
description =
"Add a face set in a shape defined by the cursor";
2128 ot->
name =
"Face Set Box Gesture";
2129 ot->
idname =
"SCULPT_OT_face_set_box_gesture";
2130 ot->
description =
"Add a face set in a rectangle defined by the cursor";
2146 ot->
name =
"Face Set Lasso Gesture";
2147 ot->
idname =
"SCULPT_OT_face_set_lasso_gesture";
2148 ot->
description =
"Add a face set in a shape defined by the cursor";
2164 ot->
name =
"Face Set Line Gesture";
2165 ot->
idname =
"SCULPT_OT_face_set_line_gesture";
2166 ot->
description =
"Add a face set to one side of a line defined by the cursor";
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for blender objects.
A BVH for high poly meshes.
#define BLT_I18NCONTEXT_AMOUNT
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define PRF_scope(category)
#define BLI_assert_unreachable()
#define POINTER_OFFSET(v, ofs)
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_ELEM_CD_SET_INT(ele, offset, f)
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BMALLOC_TEMPLATE_FROM_ME(...)
MutableSpan< T > as_mutable_span()
static IndexMask from_bools(Span< bool > bools, LinearAllocator<> &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
IndexRange index_range() const
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
bool contains(StringRef name) const
GAttributeReader lookup(const StringRef name) const
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef name)
GSpanAttributeWriter lookup_for_write_span(StringRef name)
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
constexpr IndexRange index_range() const
int64_t min_array_size() const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
IndexRange index_range() const
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
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 stroke_set_location(Paint &paint, float3 location)
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)
void ensure_boundary_info(Object &object)
bool vert_is_boundary(const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary_verts, const int vert)
void calc_face_indices_grids(const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< int > &face_indices)
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)
constexpr float FACE_SET_MIN_FADE
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)
int find_next_available_id(const Mesh &mesh)
static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op)
void fill_factor_from_hide_and_mask(const BMesh &bm, const Set< BMFace *, 0L > &faces, const MutableSpan< float > r_factors)
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)
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)
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 fill_factor_from_hide_and_mask(Span< bool > hide_vert, Span< float > mask, Span< int > verts, MutableSpan< float > r_factors)
MutableSpan< float3 > gather_grids_positions(const SubdivCCG &subdiv_ccg, const Span< int > grids, Vector< float3 > &positions)
void face_set_overlay_check(bContext &C, wmOperator &op)
void vert_random_access_ensure(Object &object)
void filter_region_clip_factors(const SculptSession &ss, Span< float3 > vert_positions, Span< int > verts, MutableSpan< float > factors)
void scale_translations(MutableSpan< float3 > translations, Span< float > factors)
bool sculpt_mode_poll(bContext *C)
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)
bool sculpt_mode_poll_view3d(bContext *C)
void flush_update_step(bContext *C, const UpdateType update_type)
void gather_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
void flush_update_done(bContext *C, Object &ob, const UpdateType update_type)
std::optional< CursorGeometryInfo > cursor_geometry_info_update(bContext *C, const float2 &mval, const bool use_sampled_normal)
void tag_update_overlays(bContext *C)
constexpr ParallelGrainSize grain_size(int grain_size)
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)
void BM_mesh_delete_hflag_context(BMesh *bm, const char hflag, const int type)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
int RNA_enum_get(PointerRNA *ptr, const char *name)
wmOperatorStatus WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void BKE_mesh_prefair_and_fair_verts(Mesh *mesh, MutableSpan< float3 > deform_vert_positions, const bool affected_verts[], eMeshFairingDepth depth)
const Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces(bke::pbvh::BMeshNode *node)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
bool BKE_base_is_visible(const View3D *v3d, const Base *base)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void WM_operator_properties_border(wmOperatorType *ot)
int RNA_int_get(PointerRNA *ptr, const char *name)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
MINLINE int max_ii(int a, int b)
wmOperatorStatus WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
Base * CTX_data_active_base(const bContext *C)
void BKE_sculptsession_free_pbvh(Object &object)
BLI_INLINE float BLI_hash_int_01(unsigned int k)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params)
Mesh -> BMesh.
void mul_m4_v3(const float M[4][4], float r[3])
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
void BKE_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, StringRef name)
void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
ToolSettings * CTX_data_tool_settings(const bContext *C)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG &subdiv_ccg, const int grid_index)
int CCG_grid_xy_to_index(const int grid_size, const int x, const int y)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
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)
wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Paint * BKE_paint_get_active_from_context(const bContext *C)
void BKE_sculptsession_update_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const StringRef name)
Scene * CTX_data_scene(const bContext *C)
Mesh * BKE_object_get_original_mesh(const Object *object)
wmOperatorStatus WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event)
@ OPTYPE_DEPENDS_ON_CURSOR
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
void BM_mesh_elem_table_init(BMesh *bm, const char htype)
VecBase< float, 3 > float3
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void WM_operator_properties_gesture_polyline(wmOperatorType *ot)
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, StringRef name)
@ BKE_MESH_BATCH_DIRTY_ALL
MINLINE int clamp_i(int value, int min, int max)
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
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)
Object * CTX_data_active_object(const bContext *C)
float RNA_float_get(PointerRNA *ptr, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
@ MESH_FAIRING_DEPTH_TANGENCY
@ MESH_FAIRING_DEPTH_POSITION
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ObjectRuntime * runtime
std::unique_ptr< SculptBoundaryInfoCache > boundary_info_cache
Array< int > edge_to_face_offsets
float3 active_vert_position(const Depsgraph &depsgraph, const Object &object) const
Array< int > edge_to_face_indices
ActiveVert active_vert() const
GroupedSpan< int > edge_to_face_map
SculptSession * sculpt_session
MutableVArraySpan< T > span
void(*) end(bContext &, GestureData &)
void(*) apply_for_symmetry_pass(bContext &, GestureData &)
void(*) begin(bContext &, wmOperator &, GestureData &)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT