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/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/pointcloud.cc')
-rw-r--r-- | source/blender/blenkernel/intern/pointcloud.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pointcloud.cc b/source/blender/blenkernel/intern/pointcloud.cc index 14ca3f58db9..29248466cdd 100644 --- a/source/blender/blenkernel/intern/pointcloud.cc +++ b/source/blender/blenkernel/intern/pointcloud.cc @@ -194,8 +194,7 @@ static void pointcloud_random(PointCloud *pointcloud) RNG *rng = BLI_rng_new(0); - blender::bke::MutableAttributeAccessor attributes = - blender::bke::pointcloud_attributes_for_write(*pointcloud); + blender::bke::MutableAttributeAccessor attributes = pointcloud->attributes_for_write(); blender::bke::SpanAttributeWriter positions = attributes.lookup_or_add_for_write_only_span<float3>(POINTCLOUD_ATTR_POSITION, ATTR_DOMAIN_POINT); @@ -258,7 +257,7 @@ PointCloud *BKE_pointcloud_new_nomain(const int totpoint) static std::optional<blender::bounds::MinMaxResult<float3>> point_cloud_bounds( const PointCloud &pointcloud) { - blender::bke::AttributeAccessor attributes = blender::bke::pointcloud_attributes(pointcloud); + blender::bke::AttributeAccessor attributes = pointcloud.attributes(); blender::VArraySpan<float3> positions = attributes.lookup_or_default<float3>( POINTCLOUD_ATTR_POSITION, ATTR_DOMAIN_POINT, float3(0)); blender::VArray<float> radii = attributes.lookup_or_default<float>( |