128#define NO_ACTIVE_LAYER bke::AttrDomain::Auto
301 return std::any_of(
indices.begin(),
indices.end(), [&](
const int i) { return data[i]; });
334 const int kb_act_idx = ob.
shapenr - 1;
342 for (
int i = 0; i <
mesh.verts_num; i++) {
343 sub_v3_v3v3(offsets[i], new_positions[i], offsets[i]);
349 if ((currkey != kb) && (*dependent)[currkey_i]) {
359 &ob, kb,
reinterpret_cast<const float(*)[3]
>(new_positions.
data()));
364 const Span<std::unique_ptr<Node>> unodes,
382 for (const int node_i : range) {
383 Node &unode = *unodes[node_i];
384 const Span<int> verts = unode.vert_indices.as_span().take_front(unode.unique_verts_num);
385 for (const int i : verts.index_range()) {
386 std::swap(unode.position[i], eval_mut[verts[i]]);
389 modified_verts.fill_indices(verts, true);
397 for (const int node_i : range) {
398 Node &unode = *unodes[node_i];
399 const Span<int> verts = unode.vert_indices.as_span().take_front(unode.unique_verts_num);
400 for (const int i : verts.index_range()) {
401 std::swap(unode.orig_position[i], key_positions[verts[i]]);
409 mesh.vert_positions_for_write().copy_from(key_positions);
416 for (const int node_i : range) {
417 Node &unode = *unodes[node_i];
418 const Span<int> verts = unode.vert_indices.as_span().take_front(unode.unique_verts_num);
419 for (const int i : verts.index_range()) {
420 std::swap(unode.position[i], eval_mut[verts[i]]);
423 modified_verts.fill_indices(verts, true);
427 if (orig_positions.data() != eval_mut.data()) {
429 for (const int node_i : range) {
430 Node &unode = *unodes[node_i];
431 const Span<int> verts = unode.vert_indices.as_span().take_front(
432 unode.unique_verts_num);
433 for (const int i : verts.index_range()) {
434 std::swap(unode.orig_position[i], orig_positions[verts[i]]);
442 PositionDeformData position_data(
depsgraph,
object);
443 threading::EnumerableThreadSpecific<Vector<float3>> all_tls;
444 threading::parallel_for(unodes.index_range(), 1, [&](
const IndexRange range) {
445 Vector<float3> &translations = all_tls.local();
446 for (const int i : range) {
447 Node &unode = *unodes[i];
448 const Span<int> verts = unode.vert_indices.as_span().take_front(unode.unique_verts_num);
449 translations.resize(verts.size());
450 translations_from_new_positions(
451 unode.position.as_span().take_front(unode.unique_verts_num),
456 gather_data_mesh(position_data.eval,
458 unode.position.as_mutable_span().take_front(unode.unique_verts_num));
460 position_data.deform(translations, verts);
462 modified_verts.fill_indices(verts, true);
479 for (
const int offset :
data.index_range()) {
480 std::swap(
data[offset], undo_data[offset]);
499 hide_vert.
span[vert] = !hide_vert.
span[vert];
500 modified_vertices[vert] =
true;
522 const bool value_a = a[j];
523 const bool value_b =
b[j];
541 for (
const int i : face_indices.index_range()) {
542 const int face = face_indices[i];
545 hide_poly.
span[face] = !hide_poly.
span[face];
546 modified_faces[face] =
true;
557 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
560 unode->vert_indices.as_span().take_front(unode->unique_verts_num),
561 color_attribute.
span,
568 modified_vertices.
fill_indices(unode->vert_indices.as_span(),
true);
584 for (
const int i : index.index_range()) {
585 const int vert = index[i];
586 if (
mask.span[vert] != unode.
mask[i]) {
587 std::swap(
mask.span[vert], unode.
mask[i]);
588 modified_vertices[vert] =
true;
609 for (
const int offset :
data.index_range()) {
610 std::swap(
data[offset], undo_data[offset]);
625 bool modified =
false;
627 const int face = face_indices[i];
632 modified_face_set_faces[face] =
true;
723 const Mesh *
mesh =
static_cast<const Mesh *
>(
object.data);
737 mesh->runtime->face_offsets_sharing_info,
739 &
geometry->face_offsets_sharing_info);
757 mesh->totface_legacy = 0;
768 geometry->face_offsets_sharing_info,
769 &
mesh->face_offset_indices,
770 &
mesh->runtime->face_offsets_sharing_info);
780 &
geometry->face_offsets_sharing_info);
809 switch (step_data.
type) {
863 subdiv,
static_cast<const Mesh *
>(
object.
data), deformed_verts);
901 "Undo step type and sculpt geometry type do not match: skipping undo state restore");
909 switch (step_data.
type) {
928 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
929 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
933 node_mask,
GrainSize(1), memory, [&](
const int i) {
944 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
949 node_mask,
GrainSize(1), memory, [&](
const int i) {
957 mesh.tag_positions_changed();
965 mesh.runtime->corner_normals_cache.tag_dirty();
983 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
984 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
988 node_mask,
GrainSize(1), memory, [&](
const int i) {
995 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
997 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1001 node_mask,
GrainSize(1), memory, [&](
const int i) {
1023 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1025 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1033 node_mask,
GrainSize(1), memory, [&](
const int i) {
1036 subdiv_ccg,
nodes[i], faces_vector);
1044 node_mask,
GrainSize(1), memory, [&](
const int i) {
1066 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1070 node_mask,
GrainSize(1), memory, [&](
const int i) {
1078 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1080 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1084 node_mask,
GrainSize(1), memory, [&](
const int i) {
1101 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1103 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1110 node_mask,
GrainSize(1), memory, [&](
const int i) {
1113 subdiv_ccg,
nodes[i], faces_vector);
1121 node_mask,
GrainSize(1), memory, [&](
const int i) {
1139 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1143 node_mask,
GrainSize(1), memory, [&](
const int i) {
1180 step_data.~StepData();
1195 if (step_data->
type != type) {
1205 return node_ptr->get();
1220 unode.
grid_hidden[i].copy_from(grid_hidden[grid_indices[i]]);
1232 unode.
normal.as_mutable_span());
1235 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1239 mesh.vert_positions();
1251 subdiv_ccg, subdiv_ccg.
normals.as_span(), unode.
grids, unode.
normal.as_mutable_span());
1264 for (
const int i :
verts.index_range()) {
1278 for (
const int i :
faces.index_range()) {
1287 if (
mask.is_empty()) {
1317 unode.
col.reinitialize(
verts.size());
1322 for (
const int face : node.
faces()) {
1323 for (
const int corner :
faces[face]) {
1392 unode.
position.reinitialize(verts_num);
1394 unode.
normal.reinitialize(verts_num);
1443 const Mesh &base_mesh = *
static_cast<const Mesh *
>(
object.data);
1449 const int verts_num = unode.
grids.
size() * grid_area;
1461 unode.
position.reinitialize(verts_num);
1463 unode.
normal.reinitialize(verts_num);
1515 Node *unode = step_data->
nodes.is_empty() ? nullptr : step_data->
nodes.first().get();
1517 if (unode ==
nullptr) {
1518 step_data->
nodes.append(std::make_unique<Node>());
1519 unode = step_data->
nodes.last().get();
1521 step_data->
type = type;
1602 std::unique_ptr<Node> unode = std::make_unique<Node>();
1623 step_data->
type = type;
1634 switch (pbvh.
type()) {
1666 step_data->
type = type;
1668 switch (pbvh.
type()) {
1676 nodes_to_fill.append({&
nodes[i], unode});
1680 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1681 fill_node_data_mesh(depsgraph, object, *node, type, *unode);
1693 nodes_to_fill.append({&
nodes[i], unode});
1697 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1698 fill_node_data_grids(object, *node, type, *unode);
1719 const char *name =
mesh->active_color_attribute;
1721 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(name);
1730 attr->
domain = meta_data->domain;
1732 attr->
type = meta_data->data_type;
1795 switch (pbvh.
type()) {
1848 size += node.
normal.as_span().size_in_bytes();
1849 size += node.
col.as_span().size_in_bytes();
1870 step_data->
nodes.append(std::move(node));
1875 for (std::unique_ptr<Node> &unode : step_data->
nodes) {
1880 step_data->
nodes.index_range(),
1884 for (const int i : range) {
1885 size += node_size_in_bytes(*step_data->nodes[i]);
1889 std::plus<size_t>());
1893 if (
wm->op_undo_depth == 0 || use_nested_undo) {
1896 if (
wm->op_undo_depth == 0) {
1906 save_active_attribute(ob, &us->active_color_end);
1955 mesh->attributes_for_write().add(
2011 const bool is_final)
2023 while ((us_iter != us) || (!is_final && us_iter == us)) {
2029 if (us_iter == us) {
2053 if (us_iter == us) {
2140 ut->
name =
"Sculpt";
2199 if (pbvh ==
nullptr) {
2252 return std::nullopt;
2262 return std::nullopt;
2273 return std::nullopt;
2303 return std::nullopt;
2305 return unode->
col.as_span();
2313 return std::nullopt;
2323 return std::nullopt;
2333 return std::nullopt;
2343 return std::nullopt;
struct CustomDataLayer * BKE_attribute_search_for_write(AttributeOwner &owner, const char *name, eCustomDataMask type, AttrDomainMask domain_mask)
void BKE_id_attributes_active_color_set(struct ID *id, const char *name)
struct CustomDataLayer * BKE_attribute_find(const AttributeOwner &owner, const char *name, eCustomDataType type, blender::bke::AttrDomain domain)
#define ATTR_DOMAIN_MASK_COLOR
#define ATTR_DOMAIN_AS_MASK(domain)
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)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
void CustomData_init_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
void CustomData_free(CustomData *data, int totelem)
#define CD_TYPE_AS_MASK(_type)
const CustomData_MeshMasks CD_MASK_MESH
KeyBlock * BKE_keyblock_from_object(Object *ob)
void BKE_keyblock_update_from_offset(const Object *ob, KeyBlock *kb, const float(*ofs)[3])
KeyBlock * BKE_keyblock_find_name(Key *key, const char name[])
std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys(const Key *key, int index)
void BKE_keyblock_update_from_vertcos(const Object *ob, KeyBlock *kb, const float(*vertCos)[3])
Key * BKE_key_from_object(Object *ob)
float(* BKE_keyblock_convert_to_vertcos(const Object *ob, const KeyBlock *kb))[3]
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
void BKE_mesh_clear_geometry(Mesh *mesh)
blender::Array< blender::float3 > BKE_multires_create_deformed_base_mesh_vert_coords(Depsgraph *depsgraph, Object *object, MultiresModifierData *mmd)
void multires_mark_as_modified(Depsgraph *depsgraph, Object *object, MultiresModifiedFlags flags)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_original_mesh(const Object *object)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
void BKE_sculptsession_free_deformMats(SculptSession *ss)
MultiresModifierData * BKE_sculpt_multires_active(const Scene *scene, Object *ob)
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
void BKE_sculptsession_free_pbvh(Object &object)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
const blender::Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces(blender::bke::pbvh::BMeshNode *node)
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts(blender::bke::pbvh::BMeshNode *node)
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_other_verts(blender::bke::pbvh::BMeshNode *node)
void BKE_pbvh_sync_visibility_from_verts(Object &object)
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
blender::BitGroupVector & BKE_subdiv_ccg_grid_hidden_ensure(SubdivCCG &subdiv_ccg)
void BKE_subdiv_ccg_grid_hidden_free(SubdivCCG &subdiv_ccg)
@ MULTIRES_HIDDEN_MODIFIED
@ MULTIRES_COORDS_MODIFIED
@ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP
const UndoType * BKE_UNDOSYS_TYPE_SCULPT
eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, bContext *C, const char *name)
UndoStep * BKE_undosys_step_push_init_with_type(UndoStack *ustack, bContext *C, const char *name, const UndoType *ut)
#define BKE_undosys_stack_limit_steps_and_memory_defaults(ustack)
UndoStep * BKE_undosys_stack_init_or_active_with_type(UndoStack *ustack, const UndoType *ut)
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
#define STRNCPY(dst, src)
#define CLOG_WARN(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
#define ID_REAL_USERS(id)
#define MAX_CUSTOMDATA_LAYER_NAME
#define CD_MASK_COLOR_ALL
@ ME_SCULPT_DYNAMIC_TOPOLOGY
Object is a sort of wrapper for general info.
void ED_undo_push(bContext *C, const char *str)
UndoStack * ED_undo_stack_get()
void ED_undosys_stack_memfile_id_changed_tag(UndoStack *ustack, ID *id)
Read Guarded memory(de)allocation.
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
void BM_log_all_added(BMesh *bm, BMLog *log)
void BM_log_original_vert_data(BMLog *log, BMVert *v, const float **r_co, const float **r_no)
void BM_log_face_modified(BMLog *log, BMFace *f)
void BM_log_redo(BMesh *bm, BMLog *log)
void BM_log_vert_before_modified(BMLog *log, BMVert *v, const int cd_vert_mask_offset)
void BM_log_entry_drop(BMLogEntry *entry)
BMLog * BM_log_from_existing_entries_create(BMesh *bm, BMLogEntry *entry)
void BM_log_undo(BMesh *bm, BMLog *log)
void BM_log_before_all_removed(BMesh *bm, BMLog *log)
BMLogEntry * BM_log_entry_add(BMLog *log)
const BMAllocTemplate bm_mesh_allocsize_default
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
void BM_mesh_normals_update(BMesh *bm)
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Span< T > as_span() const
MutableSpan< T > as_mutable_span()
IndexRange index_range() const
void fill(const T &value) const
void reinitialize(const int64_t new_size)
static AttributeOwner from_id(ID *id)
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
constexpr int64_t size_in_bytes() const
constexpr int64_t size() const
constexpr Span take_front(int64_t n) const
void append(const T &value)
Span< T > as_span() const
constexpr IndexRange take_front(int64_t n) const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr bool is_empty() const
constexpr void fill_indices(Span< IndexT > indices, const T &value) const
constexpr const T * data() const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
Span< T > as_span() const
int64_t group_size() const
IndexRange index_range() const
GAttributeReader lookup(const StringRef attribute_id) const
std::optional< AttributeMetaData > lookup_meta_data(const StringRef attribute_id) const
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name)
void tag_positions_changed(const IndexMask &node_mask)
Span< NodeT > nodes() const
void tag_face_sets_changed(const IndexMask &node_mask)
void tag_masks_changed(const IndexMask &node_mask)
void tag_visibility_changed(const IndexMask &node_mask)
void foreach_index(Fn &&fn) const
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
static float normals[][3]
bool ED_geometry_attribute_convert(Mesh *mesh, const char *name, const eCustomDataType dst_type, const blender::bke::AttrDomain dst_domain, ReportList *reports)
void MEM_freeN(void *vmemh)
IndexRange grid_range(const int grid_area, const int grid)
pbvh::Tree * pbvh_get(Object &object)
void update_bounds(const Depsgraph &depsgraph, const Object &object, Tree &pbvh)
void update_mask_mesh(const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
void update_visibility(const Object &object, Tree &pbvh)
Span< float3 > vert_normals_eval(const Depsgraph &depsgraph, const Object &object_orig)
void update_mask_grids(const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh)
MutableSpan< float3 > vert_positions_eval_for_write(const Depsgraph &depsgraph, Object &object_orig)
void store_bounds_orig(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 eval_refine_from_mesh(Subdiv *subdiv, const Mesh *mesh, Span< float3 > coarse_vert_positions)
void mode_generic_exit(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
bke::GSpanAttributeWriter active_color_attribute_for_write(Mesh &mesh)
void gather_colors_vert(OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, GSpan color_attribute, bke::AttrDomain color_domain, Span< int > verts, MutableSpan< float4 > r_colors)
void gather_colors(GSpan color_attribute, Span< int > indices, MutableSpan< float4 > r_colors)
void swap_gathered_colors(Span< int > indices, GMutableSpan color_attribute, MutableSpan< float4 > r_colors)
bke::GAttributeReader active_color_attribute(const Mesh &mesh)
static void disable(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, undo::StepData *undo_step)
bke::SpanAttributeWriter< int > ensure_face_sets_mesh(Mesh &mesh)
void sync_all_from_faces(Object &object)
static void save_active_attribute(Object &object, SculptAttrRef *attr)
void push_end(Object &ob)
void push_nodes(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, const Type type)
static void store_vert_visibility_grids(const SubdivCCG &subdiv_ccg, const bke::pbvh::GridsNode &node, Node &unode)
static bool use_multires_mesh(bContext *C)
static void geometry_push(const Object &object)
static void store_positions_grids(const SubdivCCG &subdiv_ccg, Node &unode)
static BLI_NOINLINE void bmesh_push(const Object &object, const bke::pbvh::BMeshNode *node, Type type)
static void free_step_data(StepData &step_data)
void push_multires_mesh_begin(bContext *C, const char *str)
void push_multires_mesh_end(bContext *C, const char *str)
static void fill_node_data_mesh(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::MeshNode &node, const Type type, Node &unode)
static size_t node_size_in_bytes(const Node &node)
static bool topology_matches(const StepData &step_data, const Object &object)
static SculptUndoStep * get_active_step()
static void store_face_visibility(const Mesh &mesh, Node &unode)
static void step_encode_init(bContext *, UndoStep *us_p)
static void restore_mask_grids(Object &object, Node &unode, MutableSpan< bool > modified_grids)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, Type type)
static bool use_multires_undo(const StepData &step_data, const SculptSession &ss)
void push_begin_ex(const Scene &, Object &ob, const char *name)
static void step_decode_redo_impl(bContext *C, Depsgraph *depsgraph, SculptUndoStep *us)
static void restore_geometry_data(const NodeGeometry *geometry, Mesh *mesh)
static void restore_vert_visibility_grids(SubdivCCG &subdiv_ccg, Node &unode, MutableSpan< bool > modified_grids)
void push_enter_sculpt_mode(const Scene &, Object &ob, const wmOperator *op)
static StepData * get_step_data()
static void store_vert_visibility_mesh(const Mesh &mesh, const bke::pbvh::Node &node, Node &unode)
static void restore_mask_mesh(Object &object, Node &unode, MutableSpan< bool > modified_vertices)
static void store_mask_grids(const SubdivCCG &subdiv_ccg, Node &unode)
static NodeGeometry * geometry_get(StepData &step_data)
static void store_positions_mesh(const Depsgraph &depsgraph, const Object &object, Node &unode)
static void fill_node_data_grids(const Object &object, const bke::pbvh::GridsNode &node, const Type type, Node &unode)
static void geometry_free_data(NodeGeometry *geometry)
static void step_decode_undo(bContext *C, Depsgraph *depsgraph, SculptUndoStep *us, const bool is_final)
void geometry_begin_ex(const Scene &scene, Object &ob, const char *name)
static void step_free(UndoStep *us_p)
void register_type(UndoType *ut)
static int bmesh_restore(bContext *C, Depsgraph &depsgraph, StepData &step_data, Object &object, SculptSession &ss)
static const Node * get_node(const bke::pbvh::Node *node, const Type type)
static bool step_encode(bContext *, Main *bmain, UndoStep *us_p)
static bool indices_contain_true(const Span< bool > data, const Span< int > indices)
static Node * ensure_node(StepData &step_data, const bke::pbvh::Node &node, bool &r_new)
static void save_common_data(Object &ob, SculptUndoStep *us)
void geometry_begin(const Scene &scene, Object &ob, const wmOperator *op)
static void restore_position_grids(MutableSpan< float3 > positions, const CCGKey &key, Node &unode, MutableSpan< bool > modified_grids)
static void step_decode_undo_impl(bContext *C, Depsgraph *depsgraph, SculptUndoStep *us)
static void restore_list(bContext *C, Depsgraph *depsgraph, StepData &step_data)
void geometry_end(Object &ob)
static void restore_hidden_face(Object &object, Node &unode, MutableSpan< bool > modified_faces)
static void step_decode_redo(bContext *C, Depsgraph *depsgraph, SculptUndoStep *us)
static void store_geometry_data(NodeGeometry *geometry, const Object &object)
static void store_mask_mesh(const Mesh &mesh, Node &unode)
static void bmesh_restore_generic(StepData &step_data, Object &object, SculptSession &ss)
static void restore_position_mesh(const Depsgraph &depsgraph, Object &object, const Span< std::unique_ptr< Node > > unodes, MutableSpan< bool > modified_verts)
static bool restore_active_shape_key(bContext &C, Depsgraph &depsgraph, const StepData &step_data, Object &object)
static void refine_subdiv(Depsgraph *depsgraph, SculptSession &ss, Object &object, bke::subdiv::Subdiv *subdiv)
static void store_color(const Mesh &mesh, const bke::pbvh::MeshNode &node, Node &unode)
static void update_shapekeys(const Object &ob, KeyBlock *kb, const Span< float3 > new_positions)
static void restore_vert_visibility_mesh(Object &object, Node &unode, MutableSpan< bool > modified_vertices)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
static void bmesh_enable(Object &object, StepData &step_data)
static void bmesh_restore_end(bContext *C, StepData &step_data, Object &object, SculptSession &ss)
void restore_from_bmesh_enter_geometry(const StepData &step_data, Mesh &mesh)
static void store_face_sets(const Mesh &mesh, Node &unode)
static void step_decode(bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir dir, bool is_final)
static void restore_color(Object &object, StepData &step_data, MutableSpan< bool > modified_vertices)
BMLogEntry * get_bmesh_log_entry()
static bool restore_face_sets(Object &object, Node &unode, MutableSpan< bool > modified_face_set_faces)
static void push_all_grids(const Depsgraph &depsgraph, Object *object)
void push_end_ex(Object &ob, const bool use_nested_undo)
static void restore_geometry(StepData &step_data, Object &object)
static void bmesh_restore_begin(bContext *C, StepData &step_data, Object &object, SculptSession &ss)
static void set_active_layer(bContext *C, SculptAttrRef *attr)
void object_sculpt_mode_enter(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, bool force_dyntopo, ReportList *reports)
std::optional< Span< float > > orig_mask_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
std::optional< Span< int > > orig_face_set_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
void gather_data_grids(const SubdivCCG &subdiv_ccg, Span< T > src, Span< int > grids, MutableSpan< T > node_data)
std::optional< OrigPositionData > orig_position_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
void orig_position_data_gather_bmesh(const BMLog &bm_log, const Set< BMVert *, 0 > &verts, MutableSpan< float3 > positions, MutableSpan< float3 > normals)
std::optional< Span< float4 > > orig_color_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
void gather_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
std::optional< Span< float > > orig_mask_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
std::optional< OrigPositionData > orig_position_data_lookup_mesh_all_verts(const Object &object, const bke::pbvh::MeshNode &node)
std::optional< OrigPositionData > orig_position_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
std::optional< Span< int > > orig_face_set_data_lookup_grids(const Object &object, const bke::pbvh::GridsNode &node)
void copy_shared_pointer(T *src_ptr, const ImplicitSharingInfo *src_sharing_info, T **r_dst_ptr, const ImplicitSharingInfo **r_dst_sharing_info)
void free_shared_data(T **data, const ImplicitSharingInfo **sharing_info)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
VecBase< float, 4 > float4
VecBase< float, 3 > float3
bool is_memfile_undo_flush_needed
struct SculptSession * sculpt
KeyBlock * shapekey_active
blender::float4 pivot_rot
struct SculptSession::@251246223064352150223005211001050162321211037052 multires
blender::float3 pivot_pos
MultiresModifierData * modifier
bool deform_modifiers_active
blender::Array< blender::float3 > normals
blender::BitGroupVector grid_hidden
blender::Array< float > masks
blender::Array< blender::float3 > positions
void(* step_encode_init)(bContext *C, UndoStep *us)
void(* step_free)(UndoStep *us)
bool(* poll)(struct bContext *C)
void(* step_decode)(bContext *C, Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final)
bool(* step_encode)(bContext *C, Main *bmain, UndoStep *us)
MutableVArraySpan< T > span
Span< int > grids() const
Span< int > faces() const
Span< int > verts() const
Span< int > all_verts() const
int * face_offset_indices
const ImplicitSharingInfo * face_offsets_sharing_info
Array< float3, 0 > orig_position
Vector< int > face_indices
BitGroupVector< 0 > grid_hidden
Array< float3, 0 > normal
BitVector< 0 > face_hidden
Array< int, 0 > vert_indices
Array< float4, 0 > loop_col
Array< int, 0 > face_sets
BitVector< 0 > vert_hidden
Array< float3, 0 > position
Vector< int, 0 > corner_indices
char name[MAX_CUSTOMDATA_LAYER_NAME]
SculptAttrRef active_color_start
SculptAttrRef active_color_end
Vector< std::unique_ptr< Node > > nodes
NodeGeometry geometry_original
std::string active_shape_key_name
NodeGeometry geometry_bmesh_enter
Map< const bke::pbvh::Node *, std::unique_ptr< Node > > undo_nodes_by_pbvh_node
NodeGeometry geometry_modified
struct wmOperatorType * type
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_file_tag_modified()