diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-08 05:41:39 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-08 05:41:39 +0300 |
commit | d5934974219135102f364f57c45a8b1465e2b8d9 (patch) | |
tree | 415beea6d138085505b74d52301ff913781203dd /source/blender/blenkernel/intern/geometry_component_pointcloud.cc | |
parent | 17bc29253070f1707acd40c75e4a0e5c53704b24 (diff) |
Cleanup: Use C++ methods to retrieve attribute accessors
Replace `mesh_attributes`, `mesh_attributes_for_write` and the point
cloud versions with methods on the `Mesh` and `PointCloud` types.
This makes them friendlier to use and improves readability.
Differential Revision: https://developer.blender.org/D15907
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_pointcloud.cc')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_pointcloud.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc index 238854c987e..6980b561bc3 100644 --- a/source/blender/blenkernel/intern/geometry_component_pointcloud.cc +++ b/source/blender/blenkernel/intern/geometry_component_pointcloud.cc @@ -201,18 +201,20 @@ static const AttributeAccessorFunctions &get_pointcloud_accessor_functions_ref() return fn; } -AttributeAccessor pointcloud_attributes(const PointCloud &pointcloud) +} // namespace blender::bke + +blender::bke::AttributeAccessor PointCloud::attributes() const { - return AttributeAccessor(&pointcloud, get_pointcloud_accessor_functions_ref()); + return blender::bke::AttributeAccessor(this, + blender::bke::get_pointcloud_accessor_functions_ref()); } -MutableAttributeAccessor pointcloud_attributes_for_write(PointCloud &pointcloud) +blender::bke::MutableAttributeAccessor PointCloud::attributes_for_write() { - return MutableAttributeAccessor(&pointcloud, get_pointcloud_accessor_functions_ref()); + return blender::bke::MutableAttributeAccessor( + this, blender::bke::get_pointcloud_accessor_functions_ref()); } -} // namespace blender::bke - std::optional<blender::bke::AttributeAccessor> PointCloudComponent::attributes() const { return blender::bke::AttributeAccessor(pointcloud_, |