From 79ba4fde1591ce20c23608276975c691cd3c9302 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 7 Apr 2021 15:49:02 -0500 Subject: Cleanup: Rename function, switch order of arguments The function name was not very specific, this makes it clearer that it works on instances rather than only real geometry. Also use `r_` prefix for the return argument. --- .../blenkernel/intern/geometry_set_instances.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source/blender/blenkernel/intern/geometry_set_instances.cc') diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index 10c88a47416..1a45eac8cab 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -162,10 +162,10 @@ void geometry_set_gather_instances(const GeometrySet &geometry_set, geometry_set_collect_recursive(geometry_set, unit_transform, r_instance_groups); } -void gather_attribute_info(Map &attributes, - Span component_types, - Span set_groups, - const Set &ignored_attributes) +void geometry_set_gather_instances_attribute_info(Span set_groups, + Span component_types, + const Set &ignored_attributes, + Map &r_attributes) { for (const GeometryInstanceGroup &set_group : set_groups) { const GeometrySet &set = set_group.geometry_set; @@ -189,7 +189,7 @@ void gather_attribute_info(Map &attributes, {attribute_kind->data_type, meta_data.data_type}); }; - attributes.add_or_modify(name, add_info, modify_info); + r_attributes.add_or_modify(name, add_info, modify_info); return true; }); } @@ -383,10 +383,11 @@ static void join_instance_groups_mesh(Span set_groups, /* Don't copy attributes that are stored directly in the mesh data structs. */ Map attributes; - gather_attribute_info(attributes, - component_types, - set_groups, - {"position", "material_index", "normal", "shade_smooth", "crease"}); + geometry_set_gather_instances_attribute_info( + set_groups, + component_types, + {"position", "material_index", "normal", "shade_smooth", "crease"}, + attributes); join_attributes( set_groups, component_types, attributes, static_cast(dst_component)); } @@ -410,7 +411,8 @@ static void join_instance_groups_pointcloud(Span set_grou PointCloud *pointcloud = BKE_pointcloud_new_nomain(totpoint); dst_component.replace(pointcloud); Map attributes; - gather_attribute_info(attributes, {GEO_COMPONENT_TYPE_POINT_CLOUD}, set_groups, {}); + geometry_set_gather_instances_attribute_info( + set_groups, {GEO_COMPONENT_TYPE_POINT_CLOUD}, {}, attributes); join_attributes(set_groups, {GEO_COMPONENT_TYPE_POINT_CLOUD}, attributes, -- cgit v1.2.3