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
This commit is contained in:
Hans Goudey 2021-01-26 10:10:07 -06:00
parent 66f8835f9c
commit 89484e9754
1 changed files with 4 additions and 4 deletions

View File

@ -138,17 +138,17 @@ static void determine_final_data_type_and_domain(Span<const GeometryComponent *>
CustomDataType *r_type,
AttributeDomain *r_domain)
{
Vector<CustomDataType> 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<const GeometryComponent *> src_components,