diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-16 22:29:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-16 22:29:42 +0300 |
commit | 118803893e65c52c02ed274f7be2d60c668d5b56 (patch) | |
tree | 72a807f4d31276b0b176f155aab8d14566605d36 /source | |
parent | 0793ced8ad7a49143da28c037c9cd8b37838a2c8 (diff) |
Cleanup: Simplify realizing of pointcloud instances
Just a small change to make the function slightly shorter.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_set_instances.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index 47c8df03375..90a97264c8f 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -565,6 +565,7 @@ static PointCloud *join_pointcloud_position_attribute(Span<GeometryInstanceGroup } PointCloud *new_pointcloud = BKE_pointcloud_new_nomain(totpoint); + MutableSpan new_positions{(float3 *)new_pointcloud->co, new_pointcloud->totpoint}; /* Transform each instance's point locations into the new point cloud. */ int offset = 0; @@ -576,9 +577,7 @@ static PointCloud *join_pointcloud_position_attribute(Span<GeometryInstanceGroup } for (const float4x4 &transform : set_group.transforms) { for (const int i : IndexRange(pointcloud->totpoint)) { - const float3 old_position = pointcloud->co[i]; - const float3 new_position = transform * old_position; - copy_v3_v3(new_pointcloud->co[offset + i], new_position); + new_positions[offset + i] = transform * float3(pointcloud->co[i]); } offset += pointcloud->totpoint; } |