|
Blender V4.3
|
#include <BKE_attribute.hh>
Inherits blender::bke::AttributeAccessor.
Public Member Functions | |
| MutableAttributeAccessor (void *owner, const AttributeAccessorFunctions &fn) | |
| template<typename T > | |
| AttributeWriter< T > | lookup_for_write (const StringRef attribute_id) |
| template<typename T > | |
| SpanAttributeWriter< T > | lookup_for_write_span (const StringRef attribute_id) |
| bool | add (const StringRef attribute_id, const AttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer) |
| template<typename T > | |
| bool | add (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer) |
| template<typename T > | |
| AttributeWriter< T > | lookup_or_add_for_write (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| template<typename T > | |
| SpanAttributeWriter< T > | lookup_or_add_for_write_span (const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| template<typename T > | |
| SpanAttributeWriter< T > | lookup_or_add_for_write_only_span (const StringRef attribute_id, const AttrDomain domain) |
| bool | remove (const StringRef attribute_id) |
Attribute API | |
| GAttributeWriter | lookup_for_write (StringRef attribute_id) |
| GSpanAttributeWriter | lookup_for_write_span (StringRef attribute_id) |
| bool | rename (StringRef old_attribute_id, StringRef new_attribute_id) |
| GAttributeWriter | lookup_or_add_for_write (StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| GSpanAttributeWriter | lookup_or_add_for_write_span (StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue()) |
| GSpanAttributeWriter | lookup_or_add_for_write_only_span (StringRef attribute_id, AttrDomain domain, eCustomDataType data_type) |
| void | remove_anonymous () |
Public Member Functions inherited from blender::bke::AttributeAccessor | |
| AttributeAccessor (const void *owner, const AttributeAccessorFunctions &fn) | |
| bool | domain_supported (const AttrDomain domain) const |
| int | domain_size (const AttrDomain domain) const |
| bool | is_builtin (const StringRef attribute_id) const |
| GAttributeReader | lookup (const StringRef attribute_id) const |
| GAttributeReader | lookup (const StringRef attribute_id, const AttrDomain domain) const |
| GAttributeReader | lookup (const StringRef attribute_id, const eCustomDataType data_type) const |
| template<typename T > | |
| AttributeReader< T > | lookup (const StringRef attribute_id, const std::optional< AttrDomain > domain=std::nullopt) const |
| template<typename T > | |
| AttributeReader< T > | lookup_or_default (const StringRef attribute_id, const AttrDomain domain, const T &default_value) const |
| AttributeValidator | lookup_validator (const StringRef attribute_id) const |
| GVArray | adapt_domain (const GVArray &varray, const AttrDomain from_domain, const AttrDomain to_domain) const |
| template<typename T > | |
| VArray< T > | adapt_domain (const VArray< T > &varray, const AttrDomain from_domain, const AttrDomain to_domain) const |
| void | foreach_attribute (const FunctionRef< void(const AttributeIter &)> fn) const |
| bool | contains (const StringRef attribute_id) const |
| std::optional< AttributeMetaData > | lookup_meta_data (const StringRef attribute_id) const |
| GAttributeReader | lookup (StringRef attribute_id, std::optional< AttrDomain > domain, std::optional< eCustomDataType > data_type) const |
| GAttributeReader | lookup_or_default (StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const |
| Set< StringRefNull > | all_ids () const |
Additional Inherited Members | |
Static Public Member Functions inherited from blender::bke::AttributeAccessor | |
| static std::optional< AttributeAccessor > | from_id (const ID &id) |
Protected Attributes inherited from blender::bke::AttributeAccessor | |
| void * | owner_ |
| const AttributeAccessorFunctions * | fn_ |
Extends AttributeAccessor with methods that allow modifying individual attributes as well as the set of attributes.
Definition at line 678 of file BKE_attribute.hh.
|
inline |
Definition at line 680 of file BKE_attribute.hh.
|
inline |
Definition at line 745 of file BKE_attribute.hh.
References add(), blender::bke::cpp_type_to_custom_data_type(), and blender::CPPType::get().
|
inline |
Create a new attribute.
Definition at line 734 of file BKE_attribute.hh.
References blender::bke::AttributeAccessorFunctions::add, blender::bke::AttributeAccessor::contains(), blender::bke::AttributeAccessor::fn_, and blender::bke::AttributeAccessor::owner_.
Referenced by add(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::nodes::node_geo_curve_to_points_cc::copy_curve_domain_attributes(), blender::ed::sculpt_paint::face_set::create_face_sets_mesh(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::CurvesGeometry::CurvesGeometry(), blender::ed::sculpt_paint::face_set::ensure_face_sets_mesh(), blender::bke::gather_attributes(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::bke::mesh_calc_edges(), blender::geometry::mesh_copy_selection(), blender::geometry::mesh_copy_selection_keep_edges(), blender::geometry::mesh_copy_selection_keep_verts(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::bke::GeometrySet::propagate_attributes_from_layer_to_instances(), and blender::bke::try_sharing_point_data().
|
inline |
Get a writable attribute or non if it does not exist. Make sure to call #finish after changes are done.
Definition at line 700 of file BKE_attribute.hh.
References lookup_for_write().
| GAttributeWriter blender::bke::MutableAttributeAccessor::lookup_for_write | ( | StringRef | attribute_id | ) |
Get a writable attribute or none if it does not exist. Make sure to call #finish after changes are done.
Definition at line 714 of file attribute_access.cc.
References attribute.
Referenced by lookup_for_write(), and lookup_for_write_span().
|
inline |
Same as above, but returns a type that makes it easier to work with the attribute as a span.
Definition at line 715 of file BKE_attribute.hh.
References lookup_for_write().
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_for_write_span | ( | StringRef | attribute_id | ) |
Same as above, but returns a type that makes it easier to work with the attribute as a span.
Definition at line 734 of file attribute_access.cc.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), and blender::geometry::trim_curves().
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 778 of file BKE_attribute.hh.
References blender::bke::cpp_type_to_custom_data_type(), blender::CPPType::get(), lookup_or_add_for_write(), and blender::bke::GAttributeWriter::typed().
| GAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| eCustomDataType | data_type, | ||
| const AttributeInit & | initializer = AttributeInitDefaultValue() ) |
Find an attribute with the given id, domain and data type. If it does not exist, create a new attribute. If the attribute does not exist and can't be created (e.g. because it already exists on a different domain or with a different type), none is returned.
Definition at line 743 of file attribute_access.cc.
References add().
Referenced by lookup_or_add_for_write(), lookup_or_add_for_write_only_span(), and lookup_or_add_for_write_span().
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 823 of file BKE_attribute.hh.
References lookup_or_add_for_write().
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| eCustomDataType | data_type ) |
Find an attribute with the given id, domain and data type. If it does not exist, create a new attribute. If the attribute does not exist and can't be created, none is returned.
The "only" in the name indicates that the caller should not read existing values from the span. If the attribute is not stored as span internally, the existing values won't be copied over to the span.
For trivial types, the values in a newly created attribute will not be initialized.
Definition at line 776 of file attribute_access.cc.
Referenced by BM_mesh_bm_to_me_compact(), blender::nodes::node_geo_distribute_points_on_faces_cc::compute_attribute_outputs(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::bke::copy_attributes_group_to_group(), blender::bke::copy_main_point_domain_attribute_to_mesh(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_faces(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point(), blender::geometry::create_curve_from_vert_indices(), create_mesh(), blender::bke::curve_legacy_to_curves(), blender::bke::curve_to_mesh_sweep(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::execute_realize_grease_pencil_tasks(), blender::geometry::execute_realize_mesh_tasks(), blender::geometry::execute_realize_pointcloud_tasks(), blender::geometry::extract_mesh_edges(), blender::geometry::extract_mesh_faces(), blender::geometry::extract_mesh_vertices(), blender::bke::gather_attributes(), blender::bke::gather_attributes(), blender::bke::gather_attributes(), blender::bke::gather_attributes_group_to_group(), blender::bke::gather_attributes_to_groups(), blender::geometry::gather_point_attributes_to_interpolate(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::nodes::node_geo_interpolate_curves_cc::interpolate_curve_attributes(), blender::geometry::merge_layers(), blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), paintface_flush_flags(), paintvert_flush_flags(), blender::nodes::node_geo_distribute_points_on_faces_cc::point_distribution_calculate(), blender::geometry::point_merge_by_distance(), blender::bke::GeometrySet::propagate_attributes_from_layer_to_instances(), blender::nodes::node_geo_distribute_points_on_faces_cc::propagate_existing_attributes(), blender::geometry::reorder_and_flip_attributes_group_to_group(), blender::geometry::reorder_attributes_group_to_group(), blender::ed::curves::resize_curves(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), blender::bke::retrieve_attributes_for_transfer(), blender::nodes::node_geo_interpolate_curves_cc::store_output_attributes(), and blender::nodes::node_geo_dual_mesh_cc::transfer_attributes().
|
inline |
Same as above, but should be used when the type is known at compile time.
Definition at line 792 of file BKE_attribute.hh.
References lookup_or_add_for_write().
| GSpanAttributeWriter blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span | ( | StringRef | attribute_id, |
| AttrDomain | domain, | ||
| eCustomDataType | data_type, | ||
| const AttributeInit & | initializer = AttributeInitDefaultValue() ) |
Same as above, but returns a type that makes it easier to work with the attribute as a span. If the caller newly initializes the attribute, it's better to use lookup_or_add_for_write_only_span.
Definition at line 762 of file attribute_access.cc.
Referenced by blender::ed::object::apply_eval_grease_pencil_data(), blender::create_dashes(), blender::create_envelope_strokes(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curve_to_mesh_sweep(), blender::geometry::execute_realize_grease_pencil_task(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(), mesh_merge_transform(), MOD_solidify_extrude_modifyMesh(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), blender::io::alembic::AbcPointsReader::read_geometry(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), and blender::bke::write_sharp_bezier_edges().
|
inline |
Remove an attribute.
Definition at line 840 of file BKE_attribute.hh.
References blender::bke::AttributeAccessor::fn_, blender::bke::AttributeAccessor::owner_, and blender::bke::AttributeAccessorFunctions::remove.
Referenced by BKE_mesh_material_index_clear(), BKE_pbvh_sync_visibility_from_verts(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::mesh_smooth_set(), blender::ed::sculpt_paint::select_grow::select_grow_modal(), blender::ed::sculpt_paint::set_persistent_base_exec(), blender::geometry::trim_curves(), and blender::ed::sculpt_paint::expand::write_mask_data().
| void blender::bke::MutableAttributeAccessor::remove_anonymous | ( | ) |
Remove all anonymous attributes.
Definition at line 682 of file attribute_access.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::attribute_name_is_anonymous(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), and blender::Vector< T, InlineBufferCapacity, Allocator >::pop_last().
Referenced by blender::ed::object::apply_eval_grease_pencil_data().
| bool blender::bke::MutableAttributeAccessor::rename | ( | StringRef | old_attribute_id, |
| StringRef | new_attribute_id ) |
Replace the existing attribute with a new one with a different name.
Definition at line 787 of file attribute_access.cc.
References add(), blender::bke::cpp_type_to_custom_data_type(), blender::bke::GAttributeReader::domain, blender::GVArrayCommon::is_span(), blender::bke::GAttributeReader::sharing_info, blender::GVArrayCommon::type(), and blender::bke::GAttributeReader::varray.