From 1d372bdc8b34557b34d3e19e96011c548f98b98e Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 13 Oct 2025 15:38:26 +0200 Subject: [PATCH] Refactor: Split CustomData attribute and newer attribute headers Avoid including DNA_customdata_types.h everywhere we include the attributes header. Over time the older attribute header should be used less and less. Part of #122398 Pull Request: https://projects.blender.org/blender/blender/pulls/147980 --- intern/cycles/blender/mesh.cpp | 1 + source/blender/blenkernel/BKE_attribute.hh | 11 ++++++----- .../blenkernel/BKE_attribute_legacy_convert.hh | 4 ++++ source/blender/blenkernel/intern/attribute_access.cc | 4 ++-- source/blender/blenkernel/intern/data_transfer.cc | 1 + source/blender/blenkernel/intern/material.cc | 1 + source/blender/blenkernel/intern/mesh_calc_edges.cc | 1 + .../blender/blenkernel/intern/mesh_legacy_convert.cc | 2 ++ source/blender/blenkernel/intern/mesh_remesh_voxel.cc | 1 + source/blender/blenkernel/intern/paint.cc | 1 + source/blender/blenloader/intern/versioning_300.cc | 1 + source/blender/bmesh/intern/bmesh_mesh_convert.cc | 1 + .../editors/curves/intern/curves_attribute_set.cc | 1 + source/blender/editors/curves/intern/curves_edit.cc | 2 +- .../blender/editors/curves/intern/curves_extrude.cc | 2 +- source/blender/editors/curves/intern/curves_ops.cc | 1 + .../grease_pencil/intern/grease_pencil_utils.cc | 2 +- source/blender/editors/mesh/editmesh_select.cc | 1 + source/blender/editors/mesh/mesh_data.cc | 1 + source/blender/editors/mesh/mesh_join.cc | 1 + source/blender/editors/object/object_add.cc | 1 + source/blender/editors/object/object_bake_api.cc | 1 + source/blender/editors/physics/dynamicpaint_ops.cc | 1 + .../editors/pointcloud/intern/attribute_set.cc | 1 + .../blender/editors/sculpt_paint/paint_image_proj.cc | 1 + source/blender/editors/sculpt_paint/paint_vertex.cc | 1 + .../editors/sculpt_paint/sculpt_paint_color.cc | 1 + .../blender_interface/BlenderStrokeRenderer.cpp | 1 + source/blender/geometry/intern/fillet_curves.cc | 2 +- source/blender/geometry/intern/interpolate_curves.cc | 10 ++++------ source/blender/geometry/intern/mesh_triangulate.cc | 4 ++-- source/blender/geometry/intern/set_curve_type.cc | 6 +++--- source/blender/geometry/intern/subdivide_curves.cc | 2 +- source/blender/geometry/intern/trim_curves.cc | 2 +- source/blender/io/alembic/exporter/abc_writer_mesh.cc | 1 + source/blender/io/alembic/intern/abc_customdata.cc | 1 + source/blender/io/fbx/importer/fbx_import_mesh.cc | 1 + source/blender/io/ply/importer/ply_import_mesh.cc | 1 + source/blender/io/usd/intern/usd_reader_mesh.cc | 1 + source/blender/io/usd/intern/usd_reader_shape.cc | 1 + .../io/wavefront_obj/importer/obj_import_mesh.cc | 1 + source/blender/makesrna/intern/rna_attribute.cc | 1 + source/blender/makesrna/intern/rna_material.cc | 1 + source/blender/modifiers/intern/MOD_bevel.cc | 1 + source/blender/modifiers/intern/MOD_uvproject.cc | 1 + .../geometry/nodes/node_geo_duplicate_elements.cc | 11 +++++++---- .../geometry/nodes/node_geo_input_named_attribute.cc | 2 ++ .../blender/nodes/intern/volume_grid_function_eval.cc | 1 + 48 files changed, 71 insertions(+), 28 deletions(-) diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp index af49adf4743..17ed4313e97 100644 --- a/intern/cycles/blender/mesh.cpp +++ b/intern/cycles/blender/mesh.cpp @@ -25,6 +25,7 @@ #include "util/math.h" #include "BKE_anonymous_attribute_id.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_attribute_math.hh" #include "BKE_customdata.hh" diff --git a/source/blender/blenkernel/BKE_attribute.hh b/source/blender/blenkernel/BKE_attribute.hh index 090be0f3577..117cedbb8c9 100644 --- a/source/blender/blenkernel/BKE_attribute.hh +++ b/source/blender/blenkernel/BKE_attribute.hh @@ -14,14 +14,15 @@ #include "BLI_function_ref.hh" #include "BLI_generic_pointer.hh" #include "BLI_generic_virtual_array.hh" +#include "BLI_implicit_sharing.hh" #include "BLI_math_matrix_types.hh" #include "BLI_offset_indices.hh" #include "BLI_set.hh" #include "BLI_struct_equality_utils.hh" -#include "BKE_attribute.h" #include "BKE_attribute_filters.hh" +struct ID; struct Mesh; struct PointCloud; namespace blender::fn { @@ -33,6 +34,9 @@ class GField; namespace blender::bke { +class AttributeAccessor; +class MutableAttributeAccessor; + /** Some storage types are only relevant for certain attribute types. */ enum class AttrStorageType : int8_t { /** #AttributeDataArray. */ @@ -80,9 +84,6 @@ enum class AttrDomain : int8_t { }; #define ATTR_DOMAIN_NUM 7 -const CPPType *custom_data_type_to_cpp_type(eCustomDataType type); -eCustomDataType cpp_type_to_custom_data_type(const CPPType &type); - /** * Contains information about an attribute in a geometry component. * More information can be added in the future. E.g. whether the attribute is builtin and how it is @@ -916,7 +917,7 @@ struct AttributeTransferData { Vector retrieve_attributes_for_transfer( const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, - AttrDomainMask domain_mask, + Span domains, const AttributeFilter &attribute_filter = {}); bool allow_procedural_attribute_access(StringRef attribute_name); diff --git a/source/blender/blenkernel/BKE_attribute_legacy_convert.hh b/source/blender/blenkernel/BKE_attribute_legacy_convert.hh index f0f3564f737..95d3acf9f38 100644 --- a/source/blender/blenkernel/BKE_attribute_legacy_convert.hh +++ b/source/blender/blenkernel/BKE_attribute_legacy_convert.hh @@ -6,6 +6,7 @@ #include "DNA_attribute_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_attribute_storage.hh" @@ -19,6 +20,9 @@ struct Mesh; namespace blender::bke { +const CPPType *custom_data_type_to_cpp_type(eCustomDataType type); +eCustomDataType cpp_type_to_custom_data_type(const CPPType &type); + /** * Convert a custom data type to an attribute type. May return `std::nullopt` if the custom data * type isn't used at runtime, is not a generic type that can be stored as an attribute, or is only diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 0ea228a7a05..36818088520 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -933,12 +933,12 @@ fn::GField AttributeValidator::validate_field_if_necessary(const fn::GField &fie Vector retrieve_attributes_for_transfer( const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, - const AttrDomainMask domain_mask, + Span domains, const bke::AttributeFilter &attribute_filter) { Vector attributes; src_attributes.foreach_attribute([&](const AttributeIter &iter) { - if (!(ATTR_DOMAIN_AS_MASK(iter.domain) & domain_mask)) { + if (!domains.contains(iter.domain)) { return; } if (iter.data_type == AttrType::String) { diff --git a/source/blender/blenkernel/intern/data_transfer.cc b/source/blender/blenkernel/intern/data_transfer.cc index 3fbff27b659..f2d3faee48b 100644 --- a/source/blender/blenkernel/intern/data_transfer.cc +++ b/source/blender/blenkernel/intern/data_transfer.cc @@ -19,6 +19,7 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_customdata.hh" #include "BKE_data_transfer.h" diff --git a/source/blender/blenkernel/intern/material.cc b/source/blender/blenkernel/intern/material.cc index face1a0a1b5..6901a846094 100644 --- a/source/blender/blenkernel/intern/material.cc +++ b/source/blender/blenkernel/intern/material.cc @@ -45,6 +45,7 @@ #include "BLT_translation.hh" #include "BKE_anim_data.hh" +#include "BKE_attribute.h" #include "BKE_brush.hh" #include "BKE_curve.hh" #include "BKE_curves.hh" diff --git a/source/blender/blenkernel/intern/mesh_calc_edges.cc b/source/blender/blenkernel/intern/mesh_calc_edges.cc index 2474fa300ac..2ff42ba77f5 100644 --- a/source/blender/blenkernel/intern/mesh_calc_edges.cc +++ b/source/blender/blenkernel/intern/mesh_calc_edges.cc @@ -15,6 +15,7 @@ #include "BKE_attribute.hh" #include "BKE_attribute_filter.hh" +#include "BKE_attribute_legacy_convert.hh" #include "BKE_attribute_math.hh" #include "BKE_customdata.hh" #include "BKE_mesh.hh" diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index cbb2a52eb4e..850c26c7807 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -12,6 +12,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_customdata_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" @@ -32,6 +33,7 @@ #include "BLI_task.hh" #include "BLI_utildefines.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_customdata.hh" #include "BKE_global.hh" diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index a91bd88c9ff..50294dadee8 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -21,6 +21,7 @@ #include "BLI_span.hh" #include "BLI_task.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_attribute_math.hh" #include "BKE_bvhutils.hh" diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 3207b198db1..dc8ddcf4b3f 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -44,6 +44,7 @@ #include "BKE_asset.hh" #include "BKE_asset_edit.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_brush.hh" #include "BKE_ccg.hh" diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index 537e3ce7228..b3124a60b09 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -62,6 +62,7 @@ #include "BKE_animsys.h" #include "BKE_armature.hh" #include "BKE_asset.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_collection.hh" #include "BKE_colortools.hh" diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc index df12ab7a868..a7651b8d3e4 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@ -89,6 +89,7 @@ #include "BLI_task.hh" #include "BLI_vector.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_customdata.hh" #include "BKE_mesh.hh" diff --git a/source/blender/editors/curves/intern/curves_attribute_set.cc b/source/blender/editors/curves/intern/curves_attribute_set.cc index d1bdfb74b1a..b4c1dd78c84 100644 --- a/source/blender/editors/curves/intern/curves_attribute_set.cc +++ b/source/blender/editors/curves/intern/curves_attribute_set.cc @@ -8,6 +8,7 @@ #include "BLI_generic_pointer.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_attribute_math.hh" #include "BKE_context.hh" diff --git a/source/blender/editors/curves/intern/curves_edit.cc b/source/blender/editors/curves/intern/curves_edit.cc index 21eeb210fea..104484f5e7d 100644 --- a/source/blender/editors/curves/intern/curves_edit.cc +++ b/source/blender/editors/curves/intern/curves_edit.cc @@ -398,7 +398,7 @@ static bke::CurvesGeometry copy_data_to_geometry(const bke::CurvesGeometry &src_ for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_POINT, + {bke::AttrDomain::Point}, bke::attribute_filter_from_skip_ref( ed::curves::get_curves_selection_attribute_names(src_curves)))) { diff --git a/source/blender/editors/curves/intern/curves_extrude.cc b/source/blender/editors/curves/intern/curves_extrude.cc index ee145558886..68470434b60 100644 --- a/source/blender/editors/curves/intern/curves_extrude.cc +++ b/source/blender/editors/curves/intern/curves_extrude.cc @@ -315,7 +315,7 @@ static bke::CurvesGeometry extrude_curves(const bke::CurvesGeometry &curves, for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_POINT, + {bke::AttrDomain::Point}, bke::attribute_filter_from_skip_ref(selection_attr_names))) { const CPPType &type = attribute.src.type(); diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc index d545c655601..81abb4ec7f4 100644 --- a/source/blender/editors/curves/intern/curves_ops.cc +++ b/source/blender/editors/curves/intern/curves_ops.cc @@ -23,6 +23,7 @@ #include "WM_api.hh" +#include "BKE_attribute.h" #include "BKE_attribute_math.hh" #include "BKE_bvhutils.hh" #include "BKE_context.hh" diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc index 6a8ffcd5823..06103b7abb4 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc @@ -1577,7 +1577,7 @@ Array compute_topology_change( /* Copy/Interpolate point attributes. */ for (bke::AttributeTransferData &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT)) + src_attributes, dst_attributes, {bke::AttrDomain::Point})) { bke::attribute_math::convert_to_static_type(attribute.dst.span.type(), [&](auto dummy) { using T = decltype(dummy); diff --git a/source/blender/editors/mesh/editmesh_select.cc b/source/blender/editors/mesh/editmesh_select.cc index b9db300d715..3468f63e924 100644 --- a/source/blender/editors/mesh/editmesh_select.cc +++ b/source/blender/editors/mesh/editmesh_select.cc @@ -22,6 +22,7 @@ #include "BLI_utildefines_stack.h" #include "BLI_vector.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_context.hh" #include "BKE_customdata.hh" diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc index 99adf695230..ce47f937e04 100644 --- a/source/blender/editors/mesh/mesh_data.cc +++ b/source/blender/editors/mesh/mesh_data.cc @@ -14,6 +14,7 @@ #include "BLI_array.hh" #include "BLI_math_constants.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_context.hh" #include "BKE_customdata.hh" diff --git a/source/blender/editors/mesh/mesh_join.cc b/source/blender/editors/mesh/mesh_join.cc index 4e7158af2f3..16b5daf79c0 100644 --- a/source/blender/editors/mesh/mesh_join.cc +++ b/source/blender/editors/mesh/mesh_join.cc @@ -24,6 +24,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_context.hh" #include "BKE_customdata.hh" diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index 8d9a882c8f7..de40042e94e 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -50,6 +50,7 @@ #include "BKE_anim_data.hh" #include "BKE_anonymous_attribute_id.hh" #include "BKE_armature.hh" +#include "BKE_attribute.h" #include "BKE_camera.h" #include "BKE_collection.hh" #include "BKE_constraint.h" diff --git a/source/blender/editors/object/object_bake_api.cc b/source/blender/editors/object/object_bake_api.cc index d3ddec66fc6..b9adc870676 100644 --- a/source/blender/editors/object/object_bake_api.cc +++ b/source/blender/editors/object/object_bake_api.cc @@ -28,6 +28,7 @@ #include "BLT_translation.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_callbacks.hh" #include "BKE_context.hh" diff --git a/source/blender/editors/physics/dynamicpaint_ops.cc b/source/blender/editors/physics/dynamicpaint_ops.cc index 0ad00295e5f..a43bf577dbe 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.cc +++ b/source/blender/editors/physics/dynamicpaint_ops.cc @@ -21,6 +21,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_context.hh" #include "BKE_deform.hh" diff --git a/source/blender/editors/pointcloud/intern/attribute_set.cc b/source/blender/editors/pointcloud/intern/attribute_set.cc index cdae6d0d7e0..0b64996057f 100644 --- a/source/blender/editors/pointcloud/intern/attribute_set.cc +++ b/source/blender/editors/pointcloud/intern/attribute_set.cc @@ -8,6 +8,7 @@ #include "BLI_generic_pointer.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_attribute_math.hh" #include "BKE_context.hh" diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index 9682dfd5da4..9269987428a 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -54,6 +54,7 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_brush.hh" #include "BKE_camera.h" diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 5d7eedbe607..91f6454615a 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -32,6 +32,7 @@ #include "RNA_access.hh" #include "RNA_define.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_brush.hh" #include "BKE_colortools.hh" diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc index e53bc97a3ae..8c34e549619 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc @@ -18,6 +18,7 @@ #include "BLI_vector.hh" #include "BKE_attribute.hh" +#include "BKE_attribute_legacy_convert.hh" #include "BKE_brush.hh" #include "BKE_colorband.hh" #include "BKE_colortools.hh" diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 1084e403217..c5cdeb10151 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -28,6 +28,7 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_collection.hh" #include "BKE_customdata.hh" diff --git a/source/blender/geometry/intern/fillet_curves.cc b/source/blender/geometry/intern/fillet_curves.cc index e909e0207ac..1b930040064 100644 --- a/source/blender/geometry/intern/fillet_curves.cc +++ b/source/blender/geometry/intern/fillet_curves.cc @@ -491,7 +491,7 @@ static bke::CurvesGeometry fillet_curves(const bke::CurvesGeometry &src_curves, for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_POINT, + {bke::AttrDomain::Point}, bke::attribute_filter_with_skip_ref(attribute_filter, {"position", "handle_type_left", diff --git a/source/blender/geometry/intern/interpolate_curves.cc b/source/blender/geometry/intern/interpolate_curves.cc index a9c6c0fd780..e03688472d7 100644 --- a/source/blender/geometry/intern/interpolate_curves.cc +++ b/source/blender/geometry/intern/interpolate_curves.cc @@ -15,8 +15,6 @@ #include "BLI_offset_indices.hh" #include "BLI_task.hh" -#include "DNA_customdata_types.h" - #include "GEO_interpolate_curves.hh" #include "GEO_resample_curves.hh" @@ -1217,10 +1215,10 @@ void interpolate_curves_with_samples(const CurvesGeometry &from_curves, /* Only mix "safe" attribute types for now. Other types (int, bool, etc.) are just copied from * the first curve of each pair. */ - const bool can_mix_attribute = ELEM(bke::cpp_type_to_custom_data_type(dst.type()), - CD_PROP_FLOAT, - CD_PROP_FLOAT2, - CD_PROP_FLOAT3); + const bool can_mix_attribute = ELEM(bke::cpp_type_to_attribute_type(dst.type()), + bke::AttrType::Float, + bke::AttrType::Float2, + bke::AttrType::Float3); if (can_mix_attribute && !src_from.is_empty() && !src_to.is_empty()) { array_utils::copy(GVArray::from_span(src_from), from_curve_mask, dst); array_utils::copy(GVArray::from_span(src_to), to_curve_mask, dst); diff --git a/source/blender/geometry/intern/mesh_triangulate.cc b/source/blender/geometry/intern/mesh_triangulate.cc index bcd394cfdbe..8af753a3242 100644 --- a/source/blender/geometry/intern/mesh_triangulate.cc +++ b/source/blender/geometry/intern/mesh_triangulate.cc @@ -647,7 +647,7 @@ std::optional mesh_triangulate(const Mesh &src_mesh, corner_tris.as_span(); for (auto &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, attributes, ATTR_DOMAIN_MASK_FACE, attribute_filter)) + src_attributes, attributes, {bke::AttrDomain::Face}, attribute_filter)) { bke::attribute_math::gather( attribute.src, dst_tri_to_src_face.as_span(), attribute.dst.span.slice(unique_tri_range)); @@ -682,7 +682,7 @@ std::optional mesh_triangulate(const Mesh &src_mesh, for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, attributes, - ATTR_DOMAIN_MASK_CORNER, + {bke::AttrDomain::Corner}, bke::attribute_filter_with_skip_ref(attribute_filter, {".corner_vert", ".corner_edge"}))) { diff --git a/source/blender/geometry/intern/set_curve_type.cc b/source/blender/geometry/intern/set_curve_type.cc index 2b52132106b..60d1c802046 100644 --- a/source/blender/geometry/intern/set_curve_type.cc +++ b/source/blender/geometry/intern/set_curve_type.cc @@ -303,7 +303,7 @@ static bke::CurvesGeometry convert_curves_to_bezier(const bke::CurvesGeometry &s MutableSpan dst_types_l = dst_curves.handle_types_left_for_write(); MutableSpan dst_types_r = dst_curves.handle_types_right_for_write(); Vector generic_attributes = bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, attribute_filter); + src_attributes, dst_attributes, {bke::AttrDomain::Point}, attribute_filter); Set attributes_to_skip = { "position", "handle_type_left", "handle_type_right", "handle_right", "handle_left"}; if (!dst_curves.has_curve_with_type(CURVE_TYPE_NURBS)) { @@ -483,7 +483,7 @@ static bke::CurvesGeometry convert_curves_to_nurbs(const bke::CurvesGeometry &sr MutableSpan dst_positions = dst_curves.positions_for_write(); bke::MutableAttributeAccessor dst_attributes = dst_curves.attributes_for_write(); Vector generic_attributes = bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, attribute_filter); + src_attributes, dst_attributes, {bke::AttrDomain::Point}, attribute_filter); const Set attributes_to_skip = {"position", "handle_type_left", "handle_type_right", @@ -684,7 +684,7 @@ static bke::CurvesGeometry convert_curves_to_catmull_rom_or_poly( MutableSpan dst_positions = dst_curves.positions_for_write(); bke::MutableAttributeAccessor dst_attributes = dst_curves.attributes_for_write(); Vector generic_attributes = bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, attribute_filter); + src_attributes, dst_attributes, {bke::AttrDomain::Point}, attribute_filter); const Set attributes_to_skip = {"position", "handle_type_left", "handle_type_right", diff --git a/source/blender/geometry/intern/subdivide_curves.cc b/source/blender/geometry/intern/subdivide_curves.cc index aa35a9a191a..495c6d07ed4 100644 --- a/source/blender/geometry/intern/subdivide_curves.cc +++ b/source/blender/geometry/intern/subdivide_curves.cc @@ -327,7 +327,7 @@ bke::CurvesGeometry subdivide_curves(const bke::CurvesGeometry &src_curves, Vector attributes_to_transfer = bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, attribute_filter); + src_attributes, dst_attributes, {bke::AttrDomain::Point}, attribute_filter); auto subdivide_catmull_rom = [&](const IndexMask &selection) { for (auto &attribute : attributes_to_transfer) { diff --git a/source/blender/geometry/intern/trim_curves.cc b/source/blender/geometry/intern/trim_curves.cc index eac2b0bf85e..430367dd5b5 100644 --- a/source/blender/geometry/intern/trim_curves.cc +++ b/source/blender/geometry/intern/trim_curves.cc @@ -975,7 +975,7 @@ bke::CurvesGeometry trim_curves(const bke::CurvesGeometry &src_curves, Vector transfer_attributes = bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_POINT, + {bke::AttrDomain::Point}, bke::attribute_filter_with_skip_ref(attribute_filter, {"position", "handle_left", diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index 4d83596cb8e..5dcb2ca5c6f 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -10,6 +10,7 @@ #include "abc_hierarchy_iterator.h" #include "intern/abc_axis_conversion.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_lib_id.hh" #include "BKE_material.hh" diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 08ffe15f827..c71fcf712da 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -28,6 +28,7 @@ #include "BLI_math_vector_types.hh" #include "BLI_utildefines.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_customdata.hh" #include "BKE_mesh.hh" diff --git a/source/blender/io/fbx/importer/fbx_import_mesh.cc b/source/blender/io/fbx/importer/fbx_import_mesh.cc index 47689a1463f..bd0ee6047c1 100644 --- a/source/blender/io/fbx/importer/fbx_import_mesh.cc +++ b/source/blender/io/fbx/importer/fbx_import_mesh.cc @@ -6,6 +6,7 @@ * \ingroup fbx */ +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_deform.hh" #include "BKE_key.hh" diff --git a/source/blender/io/ply/importer/ply_import_mesh.cc b/source/blender/io/ply/importer/ply_import_mesh.cc index cda61146e2c..d01b0c2be4a 100644 --- a/source/blender/io/ply/importer/ply_import_mesh.cc +++ b/source/blender/io/ply/importer/ply_import_mesh.cc @@ -6,6 +6,7 @@ * \ingroup ply */ +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_lib_id.hh" #include "BKE_mesh.hh" diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index f2626c1b18c..d7d688e4d2f 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -14,6 +14,7 @@ #include "usd_skel_convert.hh" #include "usd_utils.hh" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_customdata.hh" #include "BKE_geometry_set.hh" diff --git a/source/blender/io/usd/intern/usd_reader_shape.cc b/source/blender/io/usd/intern/usd_reader_shape.cc index 3ca6e8e8841..982c2284fc8 100644 --- a/source/blender/io/usd/intern/usd_reader_shape.cc +++ b/source/blender/io/usd/intern/usd_reader_shape.cc @@ -2,6 +2,7 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "BKE_attribute.h" #include "BKE_geometry_set.hh" #include "BKE_lib_id.hh" #include "BKE_mesh.hh" diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc index 02272090229..88b735f21e0 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc @@ -12,6 +12,7 @@ #include "DNA_material_types.h" #include "DNA_meshdata_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_deform.hh" #include "BKE_lib_id.hh" diff --git a/source/blender/makesrna/intern/rna_attribute.cc b/source/blender/makesrna/intern/rna_attribute.cc index 753068d5ed2..e3aaececef1 100644 --- a/source/blender/makesrna/intern/rna_attribute.cc +++ b/source/blender/makesrna/intern/rna_attribute.cc @@ -15,6 +15,7 @@ #include "DNA_customdata_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BLT_translation.hh" diff --git a/source/blender/makesrna/intern/rna_material.cc b/source/blender/makesrna/intern/rna_material.cc index f469d6927dc..238c19b5289 100644 --- a/source/blender/makesrna/intern/rna_material.cc +++ b/source/blender/makesrna/intern/rna_material.cc @@ -65,6 +65,7 @@ const EnumPropertyItem rna_enum_ramp_blend_items[] = { # include "DNA_screen_types.h" # include "DNA_space_types.h" +# include "BKE_attribute.h" # include "BKE_attribute.hh" # include "BKE_colorband.hh" # include "BKE_context.hh" diff --git a/source/blender/modifiers/intern/MOD_bevel.cc b/source/blender/modifiers/intern/MOD_bevel.cc index 64e78190419..2ba75e6ab2d 100644 --- a/source/blender/modifiers/intern/MOD_bevel.cc +++ b/source/blender/modifiers/intern/MOD_bevel.cc @@ -18,6 +18,7 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_curveprofile.h" #include "BKE_deform.hh" diff --git a/source/blender/modifiers/intern/MOD_uvproject.cc b/source/blender/modifiers/intern/MOD_uvproject.cc index f8453e5e167..951ac05f646 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.cc +++ b/source/blender/modifiers/intern/MOD_uvproject.cc @@ -21,6 +21,7 @@ #include "DNA_object_types.h" #include "DNA_screen_types.h" +#include "BKE_attribute.h" #include "BKE_attribute.hh" #include "BKE_camera.h" #include "BKE_customdata.hh" diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index af2bd6dc569..c39f12e253f 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -178,7 +178,7 @@ static void copy_curve_attributes_without_id(const bke::CurvesGeometry &src_curv for (auto &attribute : bke::retrieve_attributes_for_transfer( src_curves.attributes(), dst_curves.attributes_for_write(), - ATTR_DOMAIN_MASK_ALL, + {bke::AttrDomain::Point, bke::AttrDomain::Curve}, bke::attribute_filter_with_skip_ref(attribute_filter, {"id"}))) { switch (attribute.meta_data.domain) { @@ -395,7 +395,10 @@ static void copy_face_attributes_without_id(const Span edge_mapping, for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_ALL, + {bke::AttrDomain::Point, + bke::AttrDomain::Edge, + bke::AttrDomain::Face, + bke::AttrDomain::Corner}, bke::attribute_filter_with_skip_ref( attribute_filter, {"id", ".corner_vert", ".corner_edge", ".edge_verts"}))) { @@ -603,7 +606,7 @@ static void copy_edge_attributes_without_id(const Span point_mapping, for (auto &attribute : bke::retrieve_attributes_for_transfer( src_attributes, dst_attributes, - ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_EDGE, + {bke::AttrDomain::Point, bke::AttrDomain::Edge}, bke::attribute_filter_with_skip_ref(attribute_filter, {"id", ".edge_verts"}))) { switch (attribute.meta_data.domain) { @@ -792,7 +795,7 @@ static bke::CurvesGeometry duplicate_points_CurvesGeometry( for (auto &attribute : bke::retrieve_attributes_for_transfer( src_curves.attributes(), new_curves.attributes_for_write(), - ATTR_DOMAIN_MASK_CURVE, + {bke::AttrDomain::Curve}, bke::attribute_filter_with_skip_ref(attribute_filter, {"id"}))) { bke::attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc index 86c82a0832a..a432c0d1f35 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_named_attribute.cc @@ -2,6 +2,8 @@ * * SPDX-License-Identifier: GPL-2.0-or-later */ +#include "BKE_attribute_legacy_convert.hh" + #include "NOD_rna_define.hh" #include "UI_interface_layout.hh" diff --git a/source/blender/nodes/intern/volume_grid_function_eval.cc b/source/blender/nodes/intern/volume_grid_function_eval.cc index d77f6a5ea44..20be8deadd7 100644 --- a/source/blender/nodes/intern/volume_grid_function_eval.cc +++ b/source/blender/nodes/intern/volume_grid_function_eval.cc @@ -7,6 +7,7 @@ #include "FN_multi_function.hh" #include "BKE_anonymous_attribute_make.hh" +#include "BKE_attribute_legacy_convert.hh" #include "BKE_node.hh" #include "BKE_node_socket_value.hh" #include "BKE_volume_grid.hh"