121#define NO_ACTIVE_LAYER bke::AttrDomain::Auto
187 bool applied_ =
true;
325 return std::any_of(
indices.begin(),
indices.end(), [&](
const int i) { return data[i]; });
360 for (
const int i :
indices.index_range()) {
366 const Span<std::unique_ptr<Node>> unodes,
374 for (const int node_i : range) {
375 Node &unode = *unodes[node_i];
376 const Span<int> verts = unode.vert_indices.as_span().take_front(unode.unique_verts_num);
378 if (unode.orig_position.is_empty() && !shape_key_data) {
383 unode.position.as_mutable_span().take_front(unode.unique_verts_num), verts, positions);
389 MutableSpan<float3> undo_positions = unode.orig_position.is_empty() ? unode.position :
392 if (shape_key_data) {
393 MutableSpan<float3> active_data = shape_key_data->active_key_data;
395 if (!shape_key_data->dependent_keys.is_empty()) {
396 Array<float3, 1024> translations(verts.size());
397 translations_from_new_positions(undo_positions, verts, active_data, translations);
398 for (MutableSpan<float3> data : shape_key_data->dependent_keys) {
399 apply_translations(translations, verts, data);
403 if (shape_key_data->basis_key_active) {
405 scatter_data_mesh(undo_positions.as_span(), verts, positions);
407 swap_indexed_data(undo_positions.take_front(unode.unique_verts_num), verts, active_data);
411 swap_indexed_data(undo_positions.take_front(unode.unique_verts_num), verts, positions);
414 modified_verts.fill_indices(verts, true);
430 for (
const int offset :
data.index_range()) {
431 std::swap(
data[offset], undo_data[offset]);
450 hide_vert.
span[vert] = !hide_vert.
span[vert];
451 modified_verts[vert] =
true;
473 const bool value_a = a[j];
474 const bool value_b =
b[j];
494 for (
const int i : face_indices.index_range()) {
495 const int face = face_indices[
i];
498 hide_poly.
span[face] = !hide_poly.
span[face];
499 modified_faces[face] =
true;
512 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
515 unode->vert_indices.as_span().take_front(unode->unique_verts_num),
516 color_attribute.
span,
523 modified_verts.
fill_indices(unode->vert_indices.as_span(),
true);
539 for (
const int i : index.index_range()) {
540 const int vert = index[
i];
542 std::swap(
mask.span[vert], unode.
mask[
i]);
543 modified_verts[vert] =
true;
564 for (
const int offset :
data.index_range()) {
565 std::swap(
data[offset], undo_data[offset]);
580 bool modified =
false;
582 const int face = face_indices[
i];
587 modified_face_set_faces[face] =
true;
679 const Mesh *
mesh =
static_cast<const Mesh *
>(
object.data);
693 mesh->runtime->face_offsets_sharing_info,
695 &
geometry->face_offsets_sharing_info);
713 mesh->totface_legacy = 0;
724 geometry->face_offsets_sharing_info,
725 &
mesh->face_offset_indices,
726 &
mesh->runtime->face_offsets_sharing_info);
736 &
geometry->face_offsets_sharing_info);
763 switch (step_data.
type) {
817 subdiv,
static_cast<const Mesh *
>(
object.
data), deformed_verts);
856 "Undo step type and sculpt geometry type do not match: skipping undo state restore");
864 switch (step_data.
type) {
883 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
884 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
888 node_mask,
GrainSize(1), memory, [&](
const int i) {
899 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
904 node_mask,
GrainSize(1), memory, [&](
const int i) {
912 mesh.tag_positions_changed();
920 mesh.runtime->corner_normals_cache.tag_dirty();
938 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
939 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
943 node_mask,
GrainSize(1), memory, [&](
const int i) {
950 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
952 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
956 node_mask,
GrainSize(1), memory, [&](
const int i) {
978 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
980 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
988 node_mask,
GrainSize(1), memory, [&](
const int i) {
991 subdiv_ccg,
nodes[
i], faces_vector);
999 node_mask,
GrainSize(1), memory, [&](
const int i) {
1021 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1025 node_mask,
GrainSize(1), memory, [&](
const int i) {
1033 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1035 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1039 node_mask,
GrainSize(1), memory, [&](
const int i) {
1056 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1058 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1065 node_mask,
GrainSize(1), memory, [&](
const int i) {
1068 subdiv_ccg,
nodes[
i], faces_vector);
1076 node_mask,
GrainSize(1), memory, [&](
const int i) {
1094 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1098 node_mask,
GrainSize(1), memory, [&](
const int i) {
1135 step_data.~StepData();
1150 if (step_data->
type != type) {
1160 return node_ptr->get();
1175 unode.
grid_hidden[
i].copy_from(grid_hidden[grid_indices[
i]]);
1187 unode.
normal.as_mutable_span());
1190 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1194 mesh.vert_positions();
1206 subdiv_ccg, subdiv_ccg.
normals.as_span(), unode.
grids, unode.
normal.as_mutable_span());
1219 for (
const int i :
verts.index_range()) {
1233 for (
const int i :
faces.index_range()) {
1242 if (
mask.is_empty()) {
1272 unode.
col.reinitialize(
verts.size());
1277 for (
const int face : node.
faces()) {
1278 for (
const int corner :
faces[face]) {
1343 unode.
position.reinitialize(verts_num);
1345 unode.
normal.reinitialize(verts_num);
1394 const Mesh &base_mesh = *
static_cast<const Mesh *
>(
object.data);
1400 const int verts_num = unode.
grids.
size() * grid_area;
1411 unode.
position.reinitialize(verts_num);
1413 unode.
normal.reinitialize(verts_num);
1465 if (step_data->
nodes.is_empty()) {
1470 step_data->
nodes.append(std::make_unique<Node>());
1472 step_data->
type = type;
1552 std::unique_ptr<Node> new_unode = std::make_unique<Node>();
1573 step_data->
type = type;
1584 switch (pbvh.
type()) {
1616 step_data->
type = type;
1618 switch (pbvh.
type()) {
1626 nodes_to_fill.append({&
nodes[
i], unode});
1630 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1631 fill_node_data_mesh(depsgraph, object, *node, type, *unode);
1643 nodes_to_fill.append({&
nodes[
i], unode});
1647 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1648 fill_node_data_grids(object, *node, type, *unode);
1669 const char *name =
mesh->active_color_attribute;
1671 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(name);
1680 attr->
domain = meta_data->domain;
1682 attr->
type = meta_data->data_type;
1735 switch (pbvh.
type()) {
1780 size += node.
normal.as_span().size_in_bytes();
1781 size += node.
col.as_span().size_in_bytes();
1802 step_data->
nodes.append(std::move(node));
1807 for (std::unique_ptr<Node> &unode : step_data->
nodes) {
1816 step_data->
nodes.index_range(),
1820 for (const int i : range) {
1821 size += node_size_in_bytes(*step_data->nodes[i]);
1825 std::plus<size_t>());
1829 if (
wm->op_undo_depth == 0 || use_nested_undo) {
1832 if (
wm->op_undo_depth == 0) {
1839 SculptUndoStep *us =
reinterpret_cast<SculptUndoStep *
>(
1842 save_active_attribute(ob, &us->active_color_end);
1882 mesh->attributes_for_write(),
1895 mesh->attributes_for_write().add(
1951 const bool is_final)
1963 while ((us_iter != us) || (!is_final && us_iter == us)) {
1969 if (us_iter == us) {
1994 if (us_iter == us) {
2092 sizeof(
int) * (node_geometry.
faces_num + 1));
2104 size_t step_size = 0;
2124 if (
wm->op_undo_depth == 0) {
2127 if (
wm->op_undo_depth == 0) {
2136 ut->
name =
"Sculpt";
2223 return std::nullopt;
2234 return std::nullopt;
2245 return std::nullopt;
2275 return std::nullopt;
2277 return unode->
col.as_span();
2285 return std::nullopt;
2295 return std::nullopt;
2305 return std::nullopt;
2315 return std::nullopt;
struct CustomDataLayer * BKE_attribute_search_for_write(AttributeOwner &owner, blender::StringRef name, eCustomDataMask type, AttrDomainMask domain_mask)
struct CustomDataLayer * BKE_attribute_find(const AttributeOwner &owner, blender::StringRef name, eCustomDataType type, blender::bke::AttrDomain domain)
#define ATTR_DOMAIN_MASK_COLOR
#define ATTR_DOMAIN_AS_MASK(domain)
void BKE_id_attributes_active_color_set(struct ID *id, std::optional< blender::StringRef > name)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(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.
void CustomData_count_memory(const CustomData &data, int totelem, blender::MemoryCounter &memory)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
void CustomData_free(CustomData *data)
void CustomData_init_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
#define CD_TYPE_AS_MASK(_type)
const CustomData_MeshMasks CD_MASK_MESH
KeyBlock * BKE_keyblock_from_object(Object *ob)
KeyBlock * BKE_keyblock_find_name(Key *key, const char name[])
Key * BKE_key_from_object(Object *ob)
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_flush_sculpt_updates(Object *object)
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()
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * STRNCPY(char(&dst)[N], const char *src)
#define CLOG_WARN(clg_ref,...)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ 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)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const StringRef name)
BMesh const char void * data
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 int64_t size() 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 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(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 update_bounds(const Depsgraph &depsgraph, const Object &object)
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 update_visibility(const Object &object)
void foreach_index(Fn &&fn) const
static float normals[][3]
#define MAX_CUSTOMDATA_LAYER_NAME
#define CD_MASK_COLOR_ALL
#define ID_REAL_USERS(id)
IndexRange grid_range(const int grid_area, const int grid)
pbvh::Tree & pbvh_ensure(Depsgraph &depsgraph, Object &object)
pbvh::Tree * pbvh_get(Object &object)
void update_mask_bmesh(const BMesh &bm, const IndexMask &node_mask, Tree &pbvh)
void update_mask_mesh(const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
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)
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)
bool convert_attribute(AttributeOwner &owner, bke::MutableAttributeAccessor attributes, const StringRef name, const bke::AttrDomain dst_domain, const eCustomDataType dst_type, ReportList *reports)
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)
bool has_bmesh_log_entry()
static void bmesh_enable(Object &object, const StepData &step_data)
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 step_decode(bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir dir, const bool is_final)
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 refine_subdiv(Depsgraph *depsgraph, const SculptSession &ss, Object &object, bke::subdiv::Subdiv *subdiv)
static void bmesh_handle_dyntopo_end(bContext *C, StepData &step_data, Object &object)
static void restore_position_grids(const MutableSpan< float3 > positions, const CCGKey &key, Node &unode, const MutableSpan< bool > modified_grids)
static void restore_vert_visibility_mesh(Object &object, Node &unode, const MutableSpan< bool > modified_verts)
static void step_encode_init(bContext *, UndoStep *us_p)
static size_t estimate_geometry_step_size(const StepData &step_data)
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)
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 set_active_layer(bContext *C, const SculptAttrRef *attr)
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)
static void restore_hidden_face(Object &object, Node &unode, const MutableSpan< bool > modified_faces)
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 const Node * get_node(const bke::pbvh::Node *node, const Type type)
static bool step_encode(bContext *, Main *bmain, UndoStep *us_p)
static void restore_vert_visibility_grids(SubdivCCG &subdiv_ccg, Node &unode, const MutableSpan< bool > modified_grids)
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_mask_grids(Object &object, Node &unode, const 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 step_decode_redo(bContext *C, Depsgraph *depsgraph, SculptUndoStep *us)
static void restore_color(Object &object, StepData &step_data, const MutableSpan< bool > modified_verts)
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)
static void restore_position_mesh(Object &object, const Span< std::unique_ptr< Node > > unodes, const MutableSpan< bool > modified_verts)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, const Type type)
static bool restore_active_shape_key(bContext &C, Depsgraph &depsgraph, const StepData &step_data, Object &object)
static void restore_mask_mesh(Object &object, Node &unode, const MutableSpan< bool > modified_verts)
static void store_color(const Mesh &mesh, const bke::pbvh::MeshNode &node, Node &unode)
void push_begin(const Scene &scene, Object &ob, const wmOperator *op)
void restore_from_bmesh_enter_geometry(const StepData &step_data, Mesh &mesh)
static void store_face_sets(const Mesh &mesh, Node &unode)
static bool restore_face_sets(Object &object, Node &unode, const MutableSpan< bool > modified_face_set_faces)
static int bmesh_restore(bContext *C, Depsgraph &depsgraph, StepData &step_data, Object &object)
static size_t calculate_node_geometry_allocated_size(const NodeGeometry &node_geometry)
void push_end_ex(Object &ob, const bool use_nested_undo)
static void swap_indexed_data(MutableSpan< T > full, const Span< int > indices, MutableSpan< T > indexed)
static void restore_geometry(StepData &step_data, Object &object)
static void bmesh_handle_dyntopo_begin(bContext *C, StepData &step_data, Object &object)
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
blender::float3 pivot_pos
struct SculptSession::@323057044041335216000265171165256227034374206114 multires
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
static std::optional< ShapeKeyData > from_object(Object &object)
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
struct blender::ed::sculpt_paint::undo::StepData::@205353162113312325202166173342174005247067053162 grids
struct blender::ed::sculpt_paint::undo::StepData::@312030152261047154154007114345203354355113156323 bmesh
NodeGeometry geometry_original
std::string active_shape_key_name
Map< const bke::pbvh::Node *, std::unique_ptr< Node > > undo_nodes_by_pbvh_node
NodeGeometry geometry_enter
struct blender::ed::sculpt_paint::undo::StepData::@120042175076163017161062030006224243135210055325 mesh
NodeGeometry geometry_modified
struct wmOperatorType * type
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_file_tag_modified()