diff options
author | Hans Goudey <h.goudey@me.com> | 2022-08-31 01:00:36 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-08-31 01:00:36 +0300 |
commit | b5bc08686418e6d684b28d4793de2798d049fa8b (patch) | |
tree | f528eb3391b77a329df5016b8b89404ab1b41eb9 /source/blender | |
parent | 7bfabc6444181afaaccc1049a4488d30a339f9d6 (diff) |
Cleanup: Avoid using geometry component unnecessarily
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_points.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_points.cc b/source/blender/nodes/geometry/nodes/node_geo_points.cc index dd32e6714f4..e0ba1f1c810 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_points.cc @@ -69,10 +69,8 @@ static void node_geo_exec(GeoNodeExecParams params) Field<float3> position_field = params.extract_input<Field<float3>>("Position"); Field<float> radius_field = params.extract_input<Field<float>>("Radius"); - PointCloud *new_point_cloud = BKE_pointcloud_new_nomain(count); - GeometrySet geometry_set = GeometrySet::create_with_pointcloud(new_point_cloud); - PointCloudComponent &points = geometry_set.get_component_for_write<PointCloudComponent>(); - MutableAttributeAccessor attributes = *points.attributes_for_write(); + PointCloud *points = BKE_pointcloud_new_nomain(count); + MutableAttributeAccessor attributes = bke::pointcloud_attributes_for_write(*points); AttributeWriter<float3> output_position = attributes.lookup_or_add_for_write<float3>( "position", ATTR_DOMAIN_POINT); AttributeWriter<float> output_radii = attributes.lookup_or_add_for_write<float>( @@ -86,7 +84,7 @@ static void node_geo_exec(GeoNodeExecParams params) output_position.finish(); output_radii.finish(); - params.set_output("Geometry", std::move(geometry_set)); + params.set_output("Geometry", GeometrySet::create_with_pointcloud(points)); } } // namespace blender::nodes::node_geo_points_cc |