45 switch (component_type) {
69 if (attributes.has_value()) {
91 const int new_users = users_.fetch_sub(1) - 1;
130 if (!component_ptr) {
133 return *component_ptr;
135 if (component_ptr->is_mutable()) {
137 return *component_ptr;
141 component_ptr = component_ptr->copy();
142 return *component_ptr;
147 if (this->
has(type)) {
156 return components_[component_type].get();
161 return components_[component_type].has_value();
166 components_[component_type].reset();
173 if (!component_types.
contains(component_ptr->type())) {
174 component_ptr.reset();
206 components.
append(component_ptr.get());
215 bool have_minmax =
false;
229 curves.evaluated_positions());
241 stream <<
"<GeometrySet at " << &geometry_set <<
", " << geometry_set.components_.size()
249 component_ptr.reset();
256 if (!component_ptr) {
259 if (component_ptr->owns_direct_data()) {
271 if (!component_ptr->owns_direct_data()) {
312 this->get_component_for_read<GeometryComponentEditData>();
361 if (
mesh !=
nullptr) {
371 if (volume !=
nullptr) {
382 if (pointcloud !=
nullptr) {
384 component.replace(pointcloud, ownership);
401 if (
mesh ==
nullptr) {
402 this->remove<MeshComponent>();
408 this->remove<MeshComponent>();
416 this->remove<CurveComponent>();
422 this->remove<CurveComponent>();
429 if (pointcloud ==
nullptr) {
430 this->remove<PointCloudComponent>();
436 this->remove<PointCloudComponent>();
438 component.replace(pointcloud, ownership);
443 if (volume ==
nullptr) {
444 this->remove<VolumeComponent>();
450 this->remove<VolumeComponent>();
481 if (!this->has<GeometryComponentEditData>()) {
485 this->get_component_for_write<GeometryComponentEditData>();
486 return component.curves_edit_hints_.get();
490 const bool include_instances,
496 if (!this->
has(component_type)) {
500 const std::optional<AttributeAccessor> attributes =
component.attributes();
501 if (attributes.has_value()) {
510 const InstancesComponent &instances = *this->get_component_for_read<InstancesComponent>();
520 bool include_instances,
534 if (
component.attributes()->is_builtin(attribute_id)) {
535 if (!dummy_component->attributes()->is_builtin(attribute_id)) {
552 attribute_kind->domain = domain;
553 attribute_kind->data_type = meta_data.
data_type;
557 {attribute_kind->domain, domain});
559 {attribute_kind->data_type, meta_data.
data_type});
561 r_attributes.
add_or_modify(attribute_id, add_info, modify_info);
563 delete dummy_component;
567 const bool include_instances,
568 const bool ignore_empty,
579 if (!include_instances) {
583 if (instances ==
nullptr) {
588 instance_geometry_set, include_instances, ignore_empty, r_types);
593 const bool include_instances,
bool ignore_empty)
const
603 r_geometry_sets.
append(&geometry_set);
612 for (
const int handle : instances_component.
references().index_range()) {
624 if (geometry_sets.
size() == 1) {
659 std::string NormalFieldInput::socket_inspection_name()
const
661 return TIP_(
"Normal");
690 if (geometry_set ==
nullptr) {
698 bool is_instance =
false;
Generic geometry attributes built on CustomData.
Low-level operations for curves.
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_EDIT
@ GEO_COMPONENT_TYPE_CURVE
@ GEO_COMPONENT_TYPE_VOLUME
bool BKE_mesh_wrapper_minmax(const struct Mesh *me, float min[3], float max[3])
General operations for point clouds.
bool BKE_pointcloud_minmax(const struct PointCloud *pointcloud, float r_min[3], float r_max[3])
#define BLI_assert_unreachable()
static uint8 component(Color32 c, uint i)
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Map
int attribute_domain_size(eAttrDomain domain) const
virtual bool is_empty() const
virtual void ensure_owns_direct_data()=0
GeometryComponent(GeometryComponentType type)
static GeometryComponent * create(GeometryComponentType component_type)
virtual std::optional< blender::bke::AttributeAccessor > attributes() const
virtual std::optional< blender::bke::MutableAttributeAccessor > attributes_for_write()
GeometryComponentType type() const
void foreach_referenced_geometry(blender::FunctionRef< void(const GeometrySet &geometry_set)> callback) const
GeometrySet & geometry_set_from_reference(int reference_index)
blender::Span< InstanceReference > references() const
void ensure_geometry_instances()
const Mesh * get_for_read() const
auto add_or_modify(const Key &key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr))
constexpr bool contains(const T &value) const
void append(const T &value)
void append_non_duplicates(const T &value)
bool should_be_kept() const
DEGForeachIDComponentCallback callback
bool BKE_object_has_geometry_set_instances(const Object *ob)
void BKE_geometry_set_free(GeometrySet *geometry_set)
static void gather_component_types_recursive(const GeometrySet &geometry_set, const bool include_instances, const bool ignore_empty, Vector< GeometryComponentType > &r_types)
static void gather_mutable_geometry_sets(GeometrySet &geometry_set, Vector< GeometrySet * > &r_geometry_sets)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static struct PartialUpdateUser * wrap(PartialUpdateUserImpl *user)
VArray< float3 > curve_normals_varray(const CurveComponent &component, const eAttrDomain domain)
eAttrDomain attribute_domain_highest_priority(Span< eAttrDomain > domains)
eCustomDataType attribute_data_type_highest_complexity(Span< eCustomDataType > data_types)
VArray< float3 > mesh_normals_varray(const MeshComponent &mesh_component, const Mesh &mesh, const IndexMask mask, eAttrDomain domain)
static std::optional< MinMaxResult< T > > min_max(Span< T > values)
void parallel_for_each(Range &range, const Function &function)
vec_base< float, 3 > float3
unsigned __int64 uint64_t
const PointCloud * get_pointcloud_for_read() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
static GeometrySet create_with_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
blender::Vector< const GeometryComponent * > get_components_for_read() const
Curves * get_curves_for_write()
void ensure_owns_direct_data()
const Volume * get_volume_for_read() const
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only_during_modify(const blender::Span< GeometryComponentType > component_types)
GeometrySet & operator=(const GeometrySet &other)
bool has_realized_data() const
blender::Vector< GeometryComponentType > gather_component_types(bool include_instances, bool ignore_empty) const
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
void replace_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet create_with_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Component & get_component_for_write()
PointCloud * get_pointcloud_for_write()
const Mesh * get_mesh_for_read() const
bool owns_direct_data() const
const Curves * get_curves_for_read() const
void attribute_foreach(blender::Span< GeometryComponentType > component_types, bool include_instances, AttributeForeachCallback callback) const
void gather_attributes_for_propagation(blender::Span< GeometryComponentType > component_types, GeometryComponentType dst_component_type, bool include_instances, blender::Map< blender::bke::AttributeIDRef, blender::bke::AttributeKind > &r_attributes) const
friend std::ostream & operator<<(std::ostream &stream, const GeometrySet &geometry_set)
Mesh * get_mesh_for_write()
void add(const GeometryComponent &component)
bool has_instances() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
static GeometrySet create_with_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only(const blender::Span< GeometryComponentType > component_types)
blender::bke::CurvesEditHints * get_curve_edit_hints_for_write()
const blender::bke::CurvesEditHints * get_curve_edit_hints_for_read() const
Volume * get_volume_for_write()
bool compute_boundbox_without_instances(blender::float3 *r_min, blender::float3 *r_max) const
void remove_geometry_during_modify()
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Component * get_component_for_read() const
bool has_pointcloud() const
struct GeometrySet * geometry_set_eval
bool BKE_volume_min_max(const Volume *volume, float3 &r_min, float3 &r_max)