Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-01-26 19:10:07 +0300
committerHans Goudey <h.goudey@me.com>2021-01-26 19:10:07 +0300
commit89484e97548a026d0fdebe4822cb8e94c7209cf3 (patch)
tree3d6bd4b029241517eb7afa09f7ab20a974fdaa91 /source/blender/nodes
parent66f8835f9c03e7736297b5995a68e1455ed14e2a (diff)
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
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc8
1 files changed, 4 insertions, 4 deletions
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,