Blender V5.3
pointcloud.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <optional>
10
11#include "BLI_function_ref.hh"
12#include "MEM_guardedalloc.h"
13
14#include "DNA_material_types.h"
15#include "DNA_object_types.h"
17
18#include "BLI_bounds.hh"
19#include "BLI_index_range.hh"
20#include "BLI_resource_scope.hh"
21#include "BLI_span.hh"
22#include "BLI_utildefines.hh"
23#include "BLI_vector.hh"
24
25#include "BKE_anim_data.hh"
30#include "BKE_customdata.hh"
31#include "BKE_geometry_set.hh"
32#include "BKE_idtype.hh"
33#include "BKE_lib_id.hh"
34#include "BKE_lib_query.hh"
35#include "BKE_material.hh"
36#include "BKE_modifier.hh"
37#include "BKE_object.hh"
38#include "BKE_object_types.hh"
39#include "BKE_pointcloud.hh"
40
41#include "BLT_translation.hh"
42
44
45#include "BLO_read_write.hh"
46
48
49namespace blender {
50
51constexpr StringRef ATTR_POSITION = "position";
52
53static void pointcloud_init_data(ID *id)
54{
55 PointCloud *pointcloud = id_cast<PointCloud *>(id);
56 INIT_DEFAULT_STRUCT_AFTER(pointcloud, id);
57
58 new (&pointcloud->attribute_storage.wrap()) bke::AttributeStorage();
59 pointcloud->runtime = new bke::PointCloudRuntime();
60}
61
62static void pointcloud_copy_data(Main * /*bmain*/,
63 std::optional<Library *> /*owner_library*/,
64 ID *id_dst,
65 const ID *id_src,
66 const int /*flag*/)
67{
68 PointCloud *pointcloud_dst = id_cast<PointCloud *>(id_dst);
69 const PointCloud *pointcloud_src = id_cast<const PointCloud *>(id_src);
70 pointcloud_dst->mat = MEM_dupalloc(pointcloud_src->mat);
71
72 new (&pointcloud_dst->attribute_storage.wrap())
73 bke::AttributeStorage(pointcloud_src->attribute_storage.wrap());
74
75 pointcloud_dst->runtime = new bke::PointCloudRuntime();
76 pointcloud_dst->runtime->bounds_cache = pointcloud_src->runtime->bounds_cache;
77 pointcloud_dst->runtime->bounds_with_radius_cache =
78 pointcloud_src->runtime->bounds_with_radius_cache;
79 pointcloud_dst->runtime->bvh_cache = pointcloud_src->runtime->bvh_cache;
80 if (pointcloud_src->runtime->bake_materials) {
81 pointcloud_dst->runtime->bake_materials = std::make_unique<bke::bake::BakeMaterialsList>(
82 *pointcloud_src->runtime->bake_materials);
83 }
84
85 pointcloud_dst->pointcloud_batch_cache = nullptr;
86 pointcloud_dst->gsplat_batch_cache = nullptr;
87}
88
89static void pointcloud_free_data(ID *id)
90{
91 PointCloud *pointcloud = id_cast<PointCloud *>(id);
92 BKE_animdata_free(&pointcloud->id, false);
94 pointcloud->attribute_storage.wrap().~AttributeStorage();
95 MEM_SAFE_DELETE(pointcloud->mat);
96 delete pointcloud->runtime;
97}
98
100{
101 PointCloud *pointcloud = id_cast<PointCloud *>(id);
102 for (int i = 0; i < pointcloud->totcol; i++) {
104 }
105}
106
109{
110 PointCloud *pointcloud = id_cast<PointCloud *>(id);
112}
113
114static void pointcloud_blend_write(BlendWriter *writer, ID *id, const void *id_address)
115{
116 using namespace blender::bke;
117 PointCloud *pointcloud = id_cast<PointCloud *>(id);
118
119 ResourceScope scope;
120 bke::AttributeStorage::BlendWriteData attribute_data{writer, scope};
122 pointcloud->attribute_storage.wrap(),
123 !writer->is_undo(),
124 [&](const AttrDomain /*domain*/) { return pointcloud->totpoint; },
125 attribute_data);
126
127 if (attribute_data.attributes.is_empty()) {
128 pointcloud->attribute_storage.dna_attributes = nullptr;
130 }
131 else {
132 pointcloud->attribute_storage.dna_attributes = attribute_data.attributes.data();
133 pointcloud->attribute_storage.dna_attributes_num = attribute_data.attributes.size();
134 }
136
137 CustomData_reset(&pointcloud->pdata_legacy);
138
139 /* Write LibData */
140 writer->write_id_struct(
141 id_address, pointcloud, [](BlendStructWriter<PointCloud> &struct_writer) {
142 struct_writer.generated_ptr(offsetof(PointCloud, attribute_storage.dna_attributes));
143 });
144 BKE_id_blend_write(writer, &pointcloud->id);
145
146 /* Direct data */
147 pointcloud->attribute_storage.wrap().blend_write(*writer, attribute_data);
148
149 writer->write_pointer_array(pointcloud->totcol, pointcloud->mat);
150}
151
153{
154 PointCloud *pointcloud = id_cast<PointCloud *>(id);
155
156 /* Geometry */
157 CustomData_blend_read(reader, &pointcloud->pdata_legacy, pointcloud->totpoint);
158 pointcloud->attribute_storage.wrap().blend_read(*reader);
159
160 /* Materials */
161 BLO_read_pointer_array_and_validate_size(reader, &pointcloud->mat, &pointcloud->totcol);
162
163 pointcloud->runtime = new bke::PointCloudRuntime();
164}
165
167 .id_code = PointCloud::id_type,
168 .id_filter = FILTER_ID_PT,
169 .dependencies_id_types = FILTER_ID_MA,
170 .main_listbase_index = INDEX_ID_PT,
171 .struct_size = sizeof(PointCloud),
172 .name = "PointCloud",
173 .name_plural = N_("pointclouds"),
174 .translation_context = BLT_I18NCONTEXT_ID_POINTCLOUD,
176 .asset_type_info = nullptr,
177
178 .init_data = pointcloud_init_data,
179 .copy_data = pointcloud_copy_data,
180 .free_data = pointcloud_free_data,
181 .make_local = nullptr,
182 .foreach_id = pointcloud_foreach_id,
183 .foreach_cache = nullptr,
184 .foreach_path = nullptr,
185 .foreach_working_space_color = pointcloud_foreach_working_space_color,
186 .foreach_asset_weak_reference = nullptr,
187 .owner_pointer_get = nullptr,
188
189 .blend_write = pointcloud_blend_write,
190 .blend_read_data = pointcloud_blend_read_data,
191 .blend_read_after_liblink = nullptr,
192
193 .blend_read_undo_preserve = nullptr,
194
195 .lib_override_apply_post = nullptr,
196};
197
198Span<float3> PointCloud::positions() const
199{
201 this->attribute_storage.wrap(), bke::AttrDomain::Point, "position", this->totpoint)
202 .value_or(Span<float3>());
203}
204MutableSpan<float3> PointCloud::positions_for_write()
205{
207 this->attribute_storage.wrap(), bke::AttrDomain::Point, "position", this->totpoint);
208}
209
210VArray<float> PointCloud::radius() const
211{
213 this->attribute_storage.wrap(), bke::AttrDomain::Point, "radius", this->totpoint, 0.01f);
214}
215MutableSpan<float> PointCloud::radius_for_write()
216{
218 this->attribute_storage.wrap(), bke::AttrDomain::Point, "radius", this->totpoint, 0.01f);
219}
220
221PointCloud *BKE_pointcloud_add(Main *bmain, const char *name)
222{
223 PointCloud *pointcloud = BKE_id_new<PointCloud>(bmain, name);
224
225 return pointcloud;
226}
227
229{
230 PointCloud *pointcloud = static_cast<PointCloud *>(BKE_libblock_alloc(
232
233 BKE_libblock_init_empty(&pointcloud->id);
234
235 pointcloud->type = type;
236 pointcloud->totpoint = totpoint;
237
238 pointcloud->attributes_for_write().add<float3>(
240
241 return pointcloud;
242}
243
244void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src, PointCloud *pointcloud_dst)
245{
246 BLI_assert(pointcloud_src->id.tag & ID_TAG_NO_MAIN);
247
248 pointcloud_dst->type = pointcloud_src->type;
249
250 pointcloud_dst->totpoint = pointcloud_src->totpoint;
251 pointcloud_dst->attribute_storage.wrap() = std::move(pointcloud_src->attribute_storage.wrap());
252
253 pointcloud_dst->runtime->bounds_cache = pointcloud_src->runtime->bounds_cache;
254 pointcloud_dst->runtime->bounds_with_radius_cache =
255 pointcloud_src->runtime->bounds_with_radius_cache;
256 pointcloud_dst->runtime->bvh_cache = pointcloud_src->runtime->bvh_cache;
257
258 BKE_id_free(nullptr, pointcloud_src);
259}
260
261std::optional<Bounds<float3>> PointCloud::bounds_min_max(const bool use_radius) const
262{
263 using namespace blender::bke;
264 if (this->totpoint == 0) {
265 return std::nullopt;
266 }
267 if (use_radius) {
268 this->runtime->bounds_with_radius_cache.ensure([&](Bounds<float3> &r_bounds) {
269 const VArray<float> radius = this->radius();
270 if (const std::optional radius_single = radius.get_if_single()) {
271 r_bounds = *this->bounds_min_max(false);
272 r_bounds.pad(*radius_single);
273 return;
274 }
275 const Span radius_span = radius.get_internal_span();
276 r_bounds = *bounds::min_max_with_radii(this->positions(), radius_span);
277 });
278 }
279 else {
280 this->runtime->bounds_cache.ensure(
281 [&](Bounds<float3> &r_bounds) { r_bounds = *bounds::min_max(this->positions()); });
282 }
283 return use_radius ? this->runtime->bounds_with_radius_cache.data() :
284 this->runtime->bounds_cache.data();
285}
286
287std::optional<int> PointCloud::material_index_max() const
288{
289 if (this->totpoint == 0) {
290 return std::nullopt;
291 }
292 std::optional<int> max_material_index = bounds::max<int>(
293 this->attributes()
294 .lookup_or_default<int>("material_index", bke::AttrDomain::Point, 0)
295 .varray);
296 if (max_material_index.has_value()) {
297 max_material_index = std::clamp(*max_material_index, 0, MAXMAT);
298 }
299 return max_material_index;
300}
301
302void PointCloud::count_memory(MemoryCounter &memory) const
303{
304 this->attribute_storage.wrap().count_memory(memory);
305}
306
308{
309 return bke::AttributeAccessor(this, bke::pointcloud_attribute_accessor_functions());
310}
311
312bke::MutableAttributeAccessor PointCloud::attributes_for_write()
313{
314 return bke::MutableAttributeAccessor(this, bke::pointcloud_attribute_accessor_functions());
315}
316
317bool BKE_pointcloud_attribute_required(const PointCloud * /*pointcloud*/, const StringRef name)
318{
319 return name == ATTR_POSITION;
320}
321
322void BKE_pointcloud_material_remap(PointCloud *pointcloud, const uint *remap, const int remap_num)
323{
324 BKE_material_attr_indices_remap(pointcloud->attributes_for_write(), remap, remap_num);
325}
326
328{
329 dst.type = src.type;
330 dst.flag = src.flag;
331 MEM_SAFE_DELETE(dst.mat);
333 dst.totcol = src.totcol;
334 MutableSpan(dst.mat, dst.totcol).copy_from(Span(src.mat, src.totcol));
335}
336
337void pointcloud_resize(PointCloud &pointcloud, const int size)
338{
339 BLI_assert(size > 0);
340
341 const int old_totpoint = pointcloud.totpoint;
342
343 if (size == old_totpoint) {
344 return;
345 }
346
347 pointcloud.totpoint = size;
348
349 bke::MutableAttributeAccessor attributes = pointcloud.attributes_for_write();
350 if (old_totpoint == 0) {
351 /* If there were no points before, ensure the position attribute exists. */
353 }
354
355 pointcloud.attribute_storage.wrap().resize(bke::AttrDomain::Point, pointcloud.totpoint);
356
357 if (size > old_totpoint) {
358 /* Initialize new points. */
360 attributes, bke::AttrDomain::Point, {}, IndexRange::from_begin_end(old_totpoint, size));
361 }
362}
363
364/* Dependency Graph */
365
367{
368 return reinterpret_cast<PointCloud *>(
369 BKE_id_copy_ex(nullptr, &pointcloud_src->id, nullptr, LIB_ID_COPY_LOCALIZE));
370}
371
372static void pointcloud_evaluate_modifiers(Depsgraph *depsgraph,
373 Scene *scene,
374 Object *object,
375 bke::GeometrySet &geometry_set)
376{
377 /* Modifier evaluation modes. */
378 const bool use_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
379 const int required_mode = use_render ? eModifierMode_Render : eModifierMode_Realtime;
380 ModifierApplyFlag apply_flag = use_render ? MOD_APPLY_RENDER : MOD_APPLY_USECACHE;
381 const ModifierEvalContext mectx = {depsgraph, object, apply_flag};
382
384
385 /* Get effective list of modifiers to execute. Some effects like shape keys
386 * are added as virtual modifiers before the user created modifiers. */
387 VirtualModifierData virtual_modifier_data;
388 ModifierData *md = BKE_modifiers_get_virtual_modifierlist(object, &virtual_modifier_data);
389
390 /* Evaluate modifiers. */
391 for (; md; md = md->next) {
393
394 if (!BKE_modifier_is_enabled(scene, md, required_mode)) {
395 continue;
396 }
397
398 bke::ScopedModifierTimer modifier_timer{*md};
399
400 if (mti->modify_geometry_set) {
401 mti->modify_geometry_set(md, &mectx, &geometry_set);
402 }
403 }
404}
405
407{
408 if (!geometry_set.has<bke::PointCloudComponent>()) {
409 return nullptr;
410 }
411 bke::PointCloudComponent &pointcloud_component =
413 PointCloud *pointcloud = pointcloud_component.release();
414 if (pointcloud != nullptr) {
415 /* Add back, but as read-only non-owning component. */
416 pointcloud_component.replace(pointcloud, bke::GeometryOwnershipType::ReadOnly);
417 }
418 else {
419 /* The component was empty, we can also remove it. */
420 geometry_set.remove<bke::PointCloudComponent>();
421 }
422 return pointcloud;
423}
424
425void BKE_pointcloud_data_update(Depsgraph *depsgraph, Scene *scene, Object *object)
426{
427 /* Free any evaluated data and restore original data. */
429
430 /* Evaluate modifiers. */
431 PointCloud *pointcloud = id_cast<PointCloud *>(object->data);
434 pointcloud_evaluate_modifiers(depsgraph, scene, object, geometry_set);
435
436 PointCloud *pointcloud_eval = take_pointcloud_ownership_from_geometry_set(geometry_set);
437
438 /* If the geometry set did not contain a point cloud, we still create an empty one. */
439 if (pointcloud_eval == nullptr) {
440 pointcloud_eval = BKE_pointcloud_new_nomain(pointcloud->type, 0);
441 }
442
443 /* Assign evaluated object. */
444 const bool eval_is_owned = pointcloud_eval != pointcloud;
445 BKE_object_eval_assign_data(object, &pointcloud_eval->id, eval_is_owned);
446 object->runtime->geometry_set_eval = new bke::GeometrySet(std::move(geometry_set));
447}
448
449void PointCloud::tag_positions_changed()
450{
451 this->runtime->bounds_cache.tag_dirty();
452 this->runtime->bounds_with_radius_cache.tag_dirty();
453 this->runtime->bvh_cache.tag_dirty();
454}
455
456void PointCloud::tag_radii_changed()
457{
458 this->runtime->bounds_with_radius_cache.tag_dirty();
459}
460
461/* Draw Cache */
462
463void (*BKE_pointcloud_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode) = nullptr;
464void (*BKE_pointcloud_batch_cache_free_cb)(PointCloud *pointcloud) = nullptr;
465void (*BKE_gsplat_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode) = nullptr;
466void (*BKE_gsplat_batch_cache_free_cb)(PointCloud *pointcloud) = nullptr;
467
469{
470 if (pointcloud->pointcloud_batch_cache) {
472 }
473 if (pointcloud->gsplat_batch_cache) {
474 BKE_gsplat_batch_cache_dirty_tag_cb(pointcloud, mode);
475 }
476}
477
479{
480 if (pointcloud->pointcloud_batch_cache) {
482 }
483 if (pointcloud->gsplat_batch_cache) {
485 }
486}
487
488namespace bke {
489
491{
492 PointCloud *pointcloud = BKE_id_new_nomain<PointCloud>(nullptr);
493 pointcloud->type = type;
494 pointcloud->totpoint = totpoint;
495 return pointcloud;
496}
497
498} // namespace bke
499} // namespace blender
CustomData interface, see also DNA_customdata_types.h.
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
General operations for point clouds.
#define BLT_I18NCONTEXT_ID_POINTCLOUD
#define FILTER_ID_MA
Definition DNA_ID.h:1210
#define FILTER_ID_PT
Definition DNA_ID.h:1231
#define MAXMAT
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define INIT_DEFAULT_STRUCT_AFTER(struct_dst, member)
AttributeSet attributes
void generated_ptr(int64_t offset)
Definition writefile.cc:986
static constexpr IndexRange from_begin_end(const int64_t begin, const int64_t end)
constexpr MutableSpan()=default
constexpr Span()=default
void blend_read(BlendDataReader &reader)
void resize(AttrDomain domain, int64_t new_size)
void blend_write(BlendWriter &writer, const BlendWriteData &write_data)
void foreach_working_space_color(const IDTypeForeachColorFunctionCallback &fn)
void count_memory(MemoryCounter &memory) const
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
#define offsetof(t, d)
GMutableSpan get_mutable_attribute(AttributeStorage &storage, const AttrDomain domain, const CPPType &cpp_type, const StringRef name, const int64_t domain_size, const void *custom_default_value)
void fill_attribute_range_default(MutableAttributeAccessor dst_attributes, AttrDomain domain, const AttributeFilter &attribute_filter, IndexRange range)
std::optional< GSpan > get_span_attribute(const AttributeStorage &storage, const AttrDomain domain, const CPPType &cpp_type, const StringRef name, const int64_t domain_size)
PointCloud * pointcloud_new_no_attributes(PointCloudType type, int totpoint)
const AttributeAccessorFunctions & pointcloud_attribute_accessor_functions()
GVArray get_varray_attribute(const AttributeStorage &storage, AttrDomain domain, const CPPType &cpp_type, StringRef name, int64_t domain_size, const void *default_value)
void attribute_storage_blend_write_prepare(AttributeStorage &data, bool use_5_0_compatibility, FunctionRef< int(AttrDomain)> get_domain_size, AttributeStorage::BlendWriteData &write_data)
constexpr StringRef ATTR_POSITION
std::optional< Bounds< T > > min_max_with_radii(const Span< T > values, const Span< RadiusT > radii)
std::optional< Bounds< T > > min_max(const std::optional< Bounds< T > > &a, const T &b)
Definition BLI_bounds.hh:56
std::optional< T > max(const VArray< T > &values)
BMesh Iterators.
PointCloud * BKE_pointcloud_copy_for_eval(const PointCloud *pointcloud_src)
const char * BKE_idtype_idcode_to_name(short idcode)
Definition idtype.cc:261
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
static void pointcloud_foreach_working_space_color(ID *id, const IDTypeForeachColorFunctionCallback &fn)
unsigned int uint
Definition BKE_text.h:55
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src, PointCloud *pointcloud_dst)
void BKE_pointcloud_material_remap(PointCloud *pointcloud, const unsigned int *remap, int remap_num)
static PointCloud * take_pointcloud_ownership_from_geometry_set(bke::GeometrySet &geometry_set)
void BLO_read_pointer_array_and_validate_size(BlendDataReader *reader, T **ptr_p, SizeT *array_size)
void BKE_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
void BKE_object_eval_assign_data(Object *object, ID *data, bool is_owned)
Definition object.cc:1786
static void pointcloud_foreach_id(ID *id, LibraryForeachIDData *data)
Definition pointcloud.cc:99
void(*) BKE_pointcloud_batch_cache_dirty_tag_cb(PointCloud *pointcloud, int mode)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
Definition lib_id.cc:2890
static void pointcloud_evaluate_modifiers(Depsgraph *depsgraph, Scene *scene, Object *object, bke::GeometrySet &geometry_set)
@ LIB_ID_COPY_LOCALIZE
@ LIB_ID_CREATE_LOCALIZE
static void pointcloud_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void(*) BKE_pointcloud_batch_cache_free_cb(PointCloud *pointcloud)
void BKE_object_free_derived_caches(Object *ob)
Definition object.cc:1810
void CustomData_reset(CustomData *data)
static void pointcloud_blend_read_data(BlendDataReader *reader, ID *id)
IDTypeInfo IDType_ID_PT
BMesh const char void * data
void BKE_animdata_free(ID *id, bool do_id_user)
Definition anim_data.cc:174
@ MOD_APPLY_USECACHE
PointCloud * BKE_pointcloud_add(Main *bmain, const char *name)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
void pointcloud_copy_parameters(const PointCloud &src, PointCloud &dst)
void BKE_libblock_init_empty(ID *id) ATTR_NONNULL(1)
Definition lib_id.cc:1550
void BKE_modifiers_clear_errors(Object *ob)
static void pointcloud_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
Definition pointcloud.cc:62
void BKE_id_free(Main *bmain, void *idv)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
void * BKE_id_new_nomain(short type, const char *name)
Definition lib_id.cc:1617
static void pointcloud_free_data(ID *id)
Definition pointcloud.cc:89
void BKE_pointcloud_batch_cache_free(PointCloud *pointcloud)
@ INDEX_ID_PT
Definition DNA_ID.h:1331
@ ID_TAG_NO_MAIN
Definition DNA_ID.h:981
void pointcloud_resize(PointCloud &pointcloud, int size)
PointCloud * BKE_pointcloud_new_nomain(PointCloudType type, int totpoint)
void(*) BKE_gsplat_batch_cache_free_cb(PointCloud *pointcloud)
void BKE_material_attr_indices_remap(bke::MutableAttributeAccessor attributes, const unsigned int *remap, int remap_num)
static void pointcloud_init_data(ID *id)
Definition pointcloud.cc:53
static const char * ATTR_POSITION
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
Definition lib_id.cc:851
VecBase< float, 3 > float3
void BKE_pointcloud_data_update(Depsgraph *depsgraph, Scene *scene, Object *object)
bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_mode)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
void * BKE_id_new(Main *bmain, short type, const char *name)
Definition lib_id.cc:1612
void(*) BKE_gsplat_batch_cache_dirty_tag_cb(PointCloud *pointcloud, int mode)
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
Definition lib_id.cc:1545
void CustomData_blend_read(BlendDataReader *reader, CustomData *data, int count)
bool BKE_pointcloud_attribute_required(const PointCloud *pointcloud, StringRef name)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:50
struct Attribute * dna_attributes
void write_pointer_array(int64_t num, const void *data)
void generated_pointer_tag(const void *data)
void write_id_struct(const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
bool is_undo() const
void pad(const PaddingT &padding)
struct ModifierData * next
void(*) modify_geometry_set(ModifierData *md, const ModifierEvalContext *ctx, bke::GeometrySet *geometry_set)
draw::GSplatBatchCache * gsplat_batch_cache
struct CustomData pdata_legacy
bke::PointCloudRuntime * runtime
struct Material ** mat
draw::PointCloudBatchCache * pointcloud_batch_cache
struct AttributeStorage attribute_storage
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
bool has(const GeometryComponent::Type component_type) const
static GeometrySet from_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void remove(const GeometryComponent::Type component_type)
SharedCache< Bounds< float3 > > bounds_with_radius_cache
SharedCache< bke::bvh::Tree > bvh_cache
std::unique_ptr< bake::BakeMaterialsList > bake_materials
SharedCache< Bounds< float3 > > bounds_cache
#define N_(msgid)