diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-20 02:06:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-20 02:06:56 +0300 |
commit | 410a6efb747f188da30c75074d6bf318b862d5d5 (patch) | |
tree | f757ec39c23046873a323fcfd822d218c1e5579a /source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc | |
parent | e9f82d3dc7eebadcc52fdc43858d060c3a8214b2 (diff) |
Point Cloud: Remove redundant custom data pointers
Similar to e9f82d3dc7eebadcc52, but for point clouds instead.
Differential Revision: https://developer.blender.org/D15487
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc index 3394a7cad62..3d0bc9cd462 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_convex_hull.cc @@ -149,12 +149,17 @@ static Mesh *compute_hull(const GeometrySet &geometry_set) if (geometry_set.has_pointcloud()) { count++; - span_count++; const PointCloudComponent *component = geometry_set.get_component_for_read<PointCloudComponent>(); const PointCloud *pointcloud = component->get_for_read(); - positions_span = {reinterpret_cast<const float3 *>(pointcloud->co), pointcloud->totpoint}; - total_num += pointcloud->totpoint; + const bke::AttributeAccessor attributes = bke::pointcloud_attributes(*pointcloud); + const VArray<float3> positions = attributes.lookup_or_default<float3>( + "position", ATTR_DOMAIN_POINT, float3(0)); + if (positions.is_span()) { + span_count++; + positions_span = positions.get_internal_span(); + } + total_num += positions.size(); } if (geometry_set.has_curves()) { |