25 "Simple point cloud represented by points with position and radius"},
30 "A point cloud that represents the original 3D Gaussian Splats technique"},
31 {0,
nullptr, 0,
nullptr,
nullptr},
38# include <fmt/format.h>
55 return id_cast<PointCloud *>(ptr->owner_id);
60 return pointcloud->positions_for_write().data();
63static const float3 *get_pointcloud_positions_const(
const PointCloud *pointcloud)
65 return pointcloud->positions().data();
68static int rna_Point_index_get_const(
const PointerRNA *ptr)
70 const PointCloud *pointcloud = rna_pointcloud(ptr);
71 const float3 *co =
static_cast<const float3 *
>(ptr->data);
72 const float3 *positions = get_pointcloud_positions_const(pointcloud);
73 return int(co - positions);
78 return rna_Point_index_get_const(ptr);
81static int rna_PointCloud_points_length(
PointerRNA *ptr)
83 const PointCloud *pointcloud = rna_pointcloud(ptr);
84 return pointcloud->totpoint;
92 get_pointcloud_positions(pointcloud),
102 if (index < 0 || index >= pointcloud->totpoint) {
106 *ptr, RNA_Point, &get_pointcloud_positions(pointcloud)[
index], *r_ptr);
110static void rna_Point_location_get(
PointerRNA *ptr,
float value[3])
115static void rna_Point_location_set(
PointerRNA *ptr,
const float value[3])
120static float rna_Point_radius_get(
PointerRNA *ptr)
122 const PointCloud *pointcloud = rna_pointcloud(ptr);
123 return pointcloud->radius().get(rna_Point_index_get_const(ptr));
126static void rna_Point_radius_set(
PointerRNA *ptr,
float value)
129 pointcloud->radius_for_write()[rna_Point_index_get_const(ptr)] = value;
132static std::optional<std::string> rna_Point_path(
const PointerRNA *ptr)
134 return fmt::format(
"points[{}]", rna_Point_index_get_const(ptr));
139 ID *
id = ptr->owner_id;
148static void rna_PointCloud_resize(
PointCloud *pointcloud,
const int size)
201 "rna_PointCloud_points_begin",
202 "rna_iterator_array_next",
203 "rna_iterator_array_end",
204 "rna_iterator_array_get",
205 "rna_PointCloud_points_length",
206 "rna_PointCloud_points_lookup_int",
228 "rna_IDMaterials_assign_int");
Generic geometry attributes built on CustomData.
CustomData interface, see also DNA_customdata_types.h.
General operations for point clouds.
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_pointcloud(BlenderRNA *brna)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
static void rna_def_pointcloud(BlenderRNA *brna)
void rna_pointer_create_with_ancestors(const PointerRNA &parent, StructRNA *type, void *data, PointerRNA &r_ptr)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void rna_def_animdata_common(StructRNA *srna)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void DEG_id_tag_update(ID *id, unsigned int flags)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
static void rna_def_point(BlenderRNA *brna)
const EnumPropertyItem rna_enum_pointcloud_type_items[]
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
void pointcloud_resize(PointCloud &pointcloud, int size)
VecBase< float, 3 > float3
void RNA_def_property_array(PropertyRNA *prop, int length)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
void rna_def_attributes_common(StructRNA *srna, const AttributeOwnerType type)