68 pointcloud->attributes_for_write().add<
float3>(
73 std::optional<Library *> ,
86 pointcloud_dst->
runtime->bounds_cache = pointcloud_src->
runtime->bounds_cache;
87 if (pointcloud_src->
runtime->bake_materials) {
88 pointcloud_dst->
runtime->bake_materials =
89 std::make_unique<blender::bke::bake::BakeMaterialsList>(
90 *pointcloud_src->
runtime->bake_materials);
109 for (
int i = 0; i < pointcloud->
totcol; i++) {
193 for (
const int i : positions.index_range()) {
207 return {
static_cast<const float3 *
>(
261std::optional<blender::Bounds<blender::float3>> PointCloud::bounds_min_max()
const
273 r_bounds = *bounds::min_max_with_radii(positions, radii);
276 r_bounds = *bounds::min_max(positions);
279 return this->
runtime->bounds_cache.data();
319 for (; md; md = md->
next) {
343 if (pointcloud !=
nullptr) {
368 if (pointcloud_eval ==
nullptr) {
373 const bool eval_is_owned = pointcloud_eval != pointcloud;
378void PointCloud::tag_positions_changed()
380 this->
runtime->bounds_cache.tag_dirty();
383void PointCloud::tag_radii_changed()
385 this->
runtime->bounds_cache.tag_dirty();
void BKE_animdata_free(ID *id, bool do_id_user)
CustomData interface, see also DNA_customdata_types.h.
void CustomData_blend_write_prepare(CustomData &data, blender::Vector< CustomDataLayer, 16 > &layers_to_write, const blender::Set< std::string > &skip_names={})
void CustomData_count_memory(const CustomData &data, int totelem, blender::MemoryCounter &memory)
void CustomData_realloc(CustomData *data, int old_size, int new_size, eCDAllocType alloctype=CD_CONSTRUCT)
void * CustomData_get_layer_named_for_write(CustomData *data, eCustomDataType type, blender::StringRef name, int totelem)
bool CustomData_free_layer_named(CustomData *data, blender::StringRef name, const int totelem)
const void * CustomData_get_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
void CustomData_reset(CustomData *data)
void CustomData_blend_write(BlendWriter *writer, CustomData *data, blender::Span< CustomDataLayer > layers_to_write, int count, eCustomDataMask cddata_mask, ID *id)
void CustomData_init_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
void CustomData_free(CustomData *data, int totelem)
void CustomData_blend_read(BlendDataReader *reader, CustomData *data, int count)
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
const char * BKE_idtype_idcode_to_name(short idcode)
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void BKE_id_free(Main *bmain, void *idv)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
void BKE_modifiers_clear_errors(Object *ob)
bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_mode)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
void BKE_object_eval_assign_data(Object *object, ID *data, bool is_owned)
void BKE_object_free_derived_caches(Object *ob)
General operations for point clouds.
const char * POINTCLOUD_ATTR_RADIUS
PointCloud * BKE_pointcloud_new_nomain(int totpoint)
struct RNG * BLI_rng_new(unsigned int seed)
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
void BLO_read_pointer_array(BlendDataReader *reader, int array_size, void **ptr_p)
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
#define BLT_I18NCONTEXT_ID_POINTCLOUD
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
#define DNA_struct_default_get(struct_name)
Object is a sort of wrapper for general info.
struct PointCloud PointCloud
Read Guarded memory(de)allocation.
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Depsgraph * depsgraph
void *(* MEM_dupallocN)(const void *vmemh)
PointCloud * pointcloud_new_no_attributes(int totpoint)
static void pointcloud_init_data(ID *id)
PointCloud * BKE_pointcloud_copy_for_eval(const PointCloud *pointcloud_src)
void BKE_pointcloud_nomain_to_pointcloud(PointCloud *pointcloud_src, PointCloud *pointcloud_dst)
static void pointcloud_free_data(ID *id)
static void pointcloud_foreach_id(ID *id, LibraryForeachIDData *data)
const char * POINTCLOUD_ATTR_RADIUS
PointCloud * BKE_pointcloud_new_nomain(const int totpoint)
void BKE_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode)
void * BKE_pointcloud_add(Main *bmain, const char *name)
void BKE_pointcloud_batch_cache_free(PointCloud *pointcloud)
static PointCloud * take_pointcloud_ownership_from_geometry_set(blender::bke::GeometrySet &geometry_set)
void * BKE_pointcloud_add_default(Main *bmain, const char *name)
bool BKE_pointcloud_attribute_required(const PointCloud *, const char *name)
static void pointcloud_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_pointcloud_data_update(Depsgraph *depsgraph, Scene *scene, Object *object)
static void pointcloud_blend_read_data(BlendDataReader *reader, ID *id)
const char * POINTCLOUD_ATTR_POSITION
static void pointcloud_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void pointcloud_random(PointCloud *pointcloud)
void(* BKE_pointcloud_batch_cache_free_cb)(PointCloud *pointcloud)
static void pointcloud_evaluate_modifiers(Depsgraph *depsgraph, Scene *scene, Object *object, blender::bke::GeometrySet &geometry_set)
void(* BKE_pointcloud_batch_cache_dirty_tag_cb)(PointCloud *pointcloud, int mode)
struct ModifierData * next
void(* modify_geometry_set)(ModifierData *md, const ModifierEvalContext *ctx, blender::bke::GeometrySet *geometry_set)
PointCloudRuntimeHandle * runtime
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)