130#define NO_ACTIVE_LAYER bke::AttrDomain::Auto
197 bool applied_ =
true;
302 reinterpret_cast<uint8_t *
>(filter_buffer.
data()),
308 constexpr int zstd_level = 3;
310 const size_t dst_size = ZSTD_compress(compress_buffer.
data(),
311 compress_buffer.
size(),
312 filter_buffer.
data(),
313 filter_buffer.
size(),
315 if (ZSTD_isError(dst_size)) {
316 compress_buffer.
clear();
320 compress_buffer.
resize(dst_size);
326 const unsigned long long dst_size_in_bytes = ZSTD_getFrameContentSize(src.
data(), src.
size());
327 if (
ELEM(dst_size_in_bytes, ZSTD_CONTENTSIZE_ERROR, ZSTD_CONTENTSIZE_UNKNOWN)) {
332 buffer.
resize(dst_size_in_bytes);
334 if (ZSTD_isError(
result)) {
341 reinterpret_cast<uint8_t *
>(dst.
data()),
377 for (
const int i : this->nodes_to_compress.
index_range()) {
378 this->unique_verts_nums[
i] = this->nodes_to_compress[
i]->unique_verts_num;
383 this->compression_started =
true;
410 const int nodes_num =
nodes.size();
414 struct CompressLocalData {
421 CompressLocalData &local_data = all_tls.
local();
422 for (
const int i : range) {
435 data->nodes_to_compress.clear_and_shrink();
437 size_t memory_size = 0;
440 memory_size += compressed_data[
i].
as_span().size_in_bytes();
444 data->compressed_positions = std::move(compressed_data);
445 data->owner_step_data->undo_size += memory_size;
447 data->compression_ready.store(
true, std::memory_order_release);
512 return std::any_of(
indices.begin(),
indices.end(), [&](
const int i) { return data[i]; });
547 for (
const int i :
indices.index_range()) {
576 LocalData &tls = all_tls.
local();
577 for (
const int i : range) {
581 const Span<int> verts = tls.indices.as_span().take_front(unique_verts_num);
585 MutableSpan undo_positions = tls.positions.as_mutable_span();
597 if (shape_key_data) {
600 if (!shape_key_data->dependent_keys.is_empty()) {
603 undo_positions.
take_front(unique_verts_num),
verts, active_data, translations);
609 if (shape_key_data->basis_key_active) {
644 LocalData &tls = all_tls.
local();
645 for (
const int i : range) {
648 const Span<int> grids = tls.indices.as_span();
652 MutableSpan node_positions = tls.positions.as_mutable_span();
657 for (
const int offset :
data.index_range()) {
658 std::swap(
data[offset], undo_data[offset]);
682 hide_vert.
span[vert] = !hide_vert.
span[vert];
683 modified_verts[vert] =
true;
705 const bool value_a = a[j];
706 const bool value_b =
b[j];
726 for (
const int i : face_indices.index_range()) {
727 const int face = face_indices[
i];
730 hide_poly.
span[face] = !hide_poly.
span[face];
731 modified_faces[face] =
true;
744 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
747 unode->vert_indices.as_span().take_front(unode->unique_verts_num),
748 color_attribute.
span,
755 modified_verts.
fill_indices(unode->vert_indices.as_span(),
true);
771 for (
const int i : index.index_range()) {
772 const int vert = index[
i];
774 std::swap(
mask.span[vert], unode.
mask[
i]);
775 modified_verts[vert] =
true;
796 for (
const int offset :
data.index_range()) {
797 std::swap(
data[offset], undo_data[offset]);
812 bool modified =
false;
814 const int face = face_indices[
i];
819 modified_face_set_faces[face] =
true;
911 const Mesh *
mesh =
static_cast<const Mesh *
>(
object.data);
925 mesh->runtime->face_offsets_sharing_info,
927 &
geometry->face_offsets_sharing_info);
945 mesh->totface_legacy = 0;
956 geometry->face_offsets_sharing_info,
957 &
mesh->face_offset_indices,
958 &
mesh->runtime->face_offsets_sharing_info);
968 &
geometry->face_offsets_sharing_info);
995 switch (step_data.
type) {
1049 subdiv,
static_cast<const Mesh *
>(
object.
data), deformed_verts);
1088 "Undo step type and sculpt geometry type do not match: skipping undo state restore");
1096 switch (step_data.
type) {
1115 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
1120 node_mask,
GrainSize(1), memory, [&](
const int i) {
1131 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1136 node_mask,
GrainSize(1), memory, [&](
const int i) {
1144 mesh.tag_positions_changed();
1152 mesh.runtime->corner_normals_cache.tag_dirty();
1170 Array<bool> modified_grids(subdiv_ccg.grids_num,
false);
1171 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1175 node_mask,
GrainSize(1), memory, [&](
const int i) {
1182 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1184 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1188 node_mask,
GrainSize(1), memory, [&](
const int i) {
1210 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1212 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1220 node_mask,
GrainSize(1), memory, [&](
const int i) {
1223 subdiv_ccg,
nodes[
i], faces_vector);
1231 node_mask,
GrainSize(1), memory, [&](
const int i) {
1253 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1257 node_mask,
GrainSize(1), memory, [&](
const int i) {
1265 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1267 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1271 node_mask,
GrainSize(1), memory, [&](
const int i) {
1288 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1290 for (std::unique_ptr<Node> &unode : step_data.
nodes) {
1297 node_mask,
GrainSize(1), memory, [&](
const int i) {
1300 subdiv_ccg,
nodes[
i], faces_vector);
1308 node_mask,
GrainSize(1), memory, [&](
const int i) {
1326 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1330 node_mask,
GrainSize(1), memory, [&](
const int i) {
1367 step_data.~StepData();
1382 if (step_data->
type != type) {
1392 return node_ptr->get();
1407 unode.
grid_hidden[
i].copy_from(grid_hidden[grid_indices[
i]]);
1419 unode.
normal.as_mutable_span());
1422 const Mesh &
mesh = *
static_cast<const Mesh *
>(
object.data);
1426 mesh.vert_positions();
1438 subdiv_ccg, subdiv_ccg.
normals.as_span(), unode.
grids, unode.
normal.as_mutable_span());
1451 for (
const int i :
verts.index_range()) {
1465 for (
const int i :
faces.index_range()) {
1474 if (
mask.is_empty()) {
1504 unode.
col.reinitialize(
verts.size());
1509 for (
const int face : node.
faces()) {
1510 for (
const int corner :
faces[face]) {
1575 unode.
position.reinitialize(verts_num);
1577 unode.
normal.reinitialize(verts_num);
1626 const Mesh &base_mesh = *
static_cast<const Mesh *
>(
object.data);
1632 const int verts_num = unode.
grids.
size() * grid_area;
1643 unode.
position.reinitialize(verts_num);
1645 unode.
normal.reinitialize(verts_num);
1697 if (step_data->
nodes.is_empty()) {
1702 step_data->
nodes.append(std::make_unique<Node>());
1704 step_data->
type = type;
1784 std::unique_ptr<Node> new_unode = std::make_unique<Node>();
1805 step_data->
type = type;
1816 switch (pbvh.
type()) {
1848 step_data->
type = type;
1850 switch (pbvh.
type()) {
1858 nodes_to_fill.append({&
nodes[
i], unode});
1862 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1863 fill_node_data_mesh(depsgraph, object, *node, type, *unode);
1875 nodes_to_fill.append({&
nodes[
i], unode});
1879 for (const auto &[node, unode] : nodes_to_fill.as_span().slice(range)) {
1880 fill_node_data_grids(object, *node, type, *unode);
1901 const char *
name =
mesh->active_color_attribute;
1912 attr->
domain = meta_data->domain;
1967 switch (pbvh.
type()) {
2012 size += node.
normal.as_span().size_in_bytes();
2013 size += node.
col.as_span().size_in_bytes();
2034 step_data->
nodes.append(std::move(node));
2039 for (std::unique_ptr<Node> &unode : step_data->
nodes) {
2052 step_data->
nodes.index_range(),
2056 for (const int i : range) {
2057 size += node_size_in_bytes(*step_data->nodes[i]);
2061 std::plus<size_t>());
2066 if (
wm->op_undo_depth == 0 || use_nested_undo) {
2069 if (
wm->op_undo_depth == 0) {
2076 SculptUndoStep *us =
reinterpret_cast<SculptUndoStep *
>(
2079 save_active_attribute(ob, &us->active_color_end);
2119 mesh->attributes_for_write(),
2132 mesh->attributes_for_write().add(attr->
name,
2190 const bool is_final)
2202 while ((us_iter != us) || (!is_final && us_iter == us)) {
2208 if (us_iter == us) {
2233 if (us_iter == us) {
2331 sizeof(
int) * (node_geometry.
faces_num + 1));
2343 size_t step_size = 0;
2363 if (
wm->op_undo_depth == 0) {
2366 if (
wm->op_undo_depth == 0) {
2375 ut->
name =
"Sculpt";
2462 return std::nullopt;
2473 return std::nullopt;
2484 return std::nullopt;
2514 return std::nullopt;
2516 return unode->
col.as_span();
2524 return std::nullopt;
2534 return std::nullopt;
2544 return std::nullopt;
2554 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)
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)
@ MULTIRES_HIDDEN_MODIFIED
@ MULTIRES_COORDS_MODIFIED
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)
@ 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)
#define STRNCPY_UTF8(dst, src)
void BLI_task_pool_work_and_wait(TaskPool *pool)
TaskPool * BLI_task_pool_create_background(void *userdata, eTaskPriority priority)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
#define SCOPED_TIMER_AVERAGED(name)
#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
@ 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)
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
Span< T > as_span() const
void reinitialize(const int64_t new_size)
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
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 Span< T > as_span() const
constexpr void fill_indices(Span< IndexT > indices, const T &value) const
constexpr MutableSpan take_front(const int64_t n) const
NonMovable(NonMovable &&other)=delete
constexpr int64_t size_in_bytes() const
constexpr const T * data() const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
IndexRange index_range() const
void resize(const int64_t new_size)
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, AttrType 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]
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
IndexRange grid_range(const int grid_area, const int grid)
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)
std::optional< eCustomDataType > attr_type_to_custom_data_type(AttrType attr_type)
std::optional< AttrType > custom_data_type_to_attr_type(eCustomDataType data_type)
bool convert_attribute(AttributeOwner &owner, bke::MutableAttributeAccessor attributes, const StringRef name, const bke::AttrDomain dst_domain, const bke::AttrType 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)
void filter_decompress(const Span< std::byte > src, Vector< std::byte > &buffer, Vector< T > &dst)
template void filter_decompress< float3 >(Span< std::byte >, Vector< std::byte > &, Vector< float3 > &)
template void filter_decompress< int >(Span< std::byte >, Vector< std::byte > &, Vector< int > &)
template void filter_compress< float3 >(Span< float3 >, Vector< std::byte > &, Vector< std::byte > &)
template void filter_compress< int >(Span< int >, Vector< std::byte > &, Vector< std::byte > &)
void filter_compress(const Span< T > src, Vector< std::byte > &filter_buffer, Vector< std::byte > &compress_buffer)
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)
size_t step_memory_size_get(UndoStep *step)
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_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 restore_position_grids(const MutableSpan< float3 > positions, const CCGKey &key, PositionUndoStorage &undo_data, const MutableSpan< bool > modified_grids)
static void step_free(UndoStep *us_p)
void register_type(UndoType *ut)
static void restore_position_mesh(Object &object, PositionUndoStorage &undo_data, const MutableSpan< bool > modified_verts)
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)
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)
void translations_from_new_positions(Span< float3 > new_positions, Span< int > verts, Span< float3 > old_positions, MutableSpan< float3 > translations)
std::optional< Span< float4 > > orig_color_data_lookup_mesh(const Object &object, const bke::pbvh::MeshNode &node)
void scatter_data_mesh(Span< T > src, Span< int > indices, MutableSpan< T > dst)
void apply_translations(Span< float3 > translations, Span< int > verts, MutableSpan< float3 > positions)
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 isolate_task(const Function &function)
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)
void filter_transpose_delta(const uint8_t *src, uint8_t *dst, size_t items_num, size_t item_size)
VecBase< float, 4 > float4
VecBase< float, 3 > float3
void unfilter_transpose_delta(const uint8_t *src, uint8_t *dst, size_t items_num, size_t item_size)
bool is_memfile_undo_flush_needed
struct SculptSession * sculpt
KeyBlock * shapekey_active
blender::float4 pivot_rot
blender::float3 pivot_pos
struct SculptSession::@300305335361021334214041350300054316061376210174 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
std::atomic< bool > compression_ready
Array< Array< std::byte > > compressed_indices
TaskPool * compression_task_pool
void ensure_compression_complete()
Array< int > unique_verts_nums
std::atomic< bool > compression_started
static void compress_fn(TaskPool *, void *task_data)
StepData * owner_step_data
PositionUndoStorage(StepData &step_data)
Vector< std::unique_ptr< Node > > nodes_to_compress
Array< Array< std::byte > > compressed_positions
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::@003361057031346165147254064063355303362213163250 bmesh
NodeGeometry geometry_original
std::unique_ptr< PositionUndoStorage > position_step_storage
std::string active_shape_key_name
Map< const bke::pbvh::Node *, std::unique_ptr< Node > > undo_nodes_by_pbvh_node
struct blender::ed::sculpt_paint::undo::StepData::@366317265143151251156360154171061027264271376261 mesh
struct blender::ed::sculpt_paint::undo::StepData::@100246257151307200201214251232151127242076121134 grids
NodeGeometry geometry_enter
NodeGeometry geometry_modified
struct wmOperatorType * type
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_file_tag_modified()