[Bf-blender-cvs] [89484e97548] master: Geometry Nodes: Use highest complexity attribute in join node
Hans Goudey
noreply at git.blender.org
Tue Jan 26 17:10:13 CET 2021
Commit: 89484e97548a026d0fdebe4822cb8e94c7209cf3
Author: Hans Goudey
Date: Tue Jan 26 10:10:07 2021 -0600
Branches: master
https://developer.blender.org/rB89484e97548a026d0fdebe4822cb8e94c7209cf3
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
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
===================================================================
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<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,
More information about the Bf-blender-cvs
mailing list