From 89484e97548a026d0fdebe4822cb8e94c7209cf3 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 26 Jan 2021 10:10:07 -0600 Subject: Geometry Nodes: Use highest complexity attribute in join node This just implements a todo with a utility function that didn't exist at the time. For example, if one geometry has a "scale" attribute with a float type and another has a "scale" attribute with a vector type, the vector type will be used for the resulting geometry. Differential Revision: https://developer.blender.org/D10206 --- source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc index 02f0aca9c23..5c768531868 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc @@ -138,17 +138,17 @@ static void determine_final_data_type_and_domain(Span CustomDataType *r_type, AttributeDomain *r_domain) { + Vector data_types; for (const GeometryComponent *component : components) { ReadAttributePtr attribute = component->attribute_try_get_for_read(attribute_name); if (attribute) { - /* TODO: Use data type with most information. */ - *r_type = bke::cpp_type_to_custom_data_type(attribute->cpp_type()); + data_types.append(attribute->custom_data_type()); /* TODO: Use highest priority domain. */ *r_domain = attribute->domain(); - return; } } - BLI_assert(false); + + *r_type = attribute_data_type_highest_complexity(data_types); } static void fill_new_attribute(Span src_components, -- cgit v1.2.3