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:
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
index 3d3a72dd910..9a780e1212b 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
@@ -136,14 +136,21 @@ static void attribute_mix_calc(GeometryComponent &component, const GeoNodeExecPa
const bNode &node = params.node();
const NodeAttributeMix *node_storage = (const NodeAttributeMix *)node.storage;
- CustomDataType result_type = CD_PROP_COLOR;
+ /* Use the highest complexity data type among the inputs and outputs, that way the node will
+ * never "remove information". Use CD_PROP_BOOL as the lowest complexity data type, but in any
+ * real situation it won't be returned. */
+ const CustomDataType result_type = attribute_data_type_highest_complexity({
+ params.get_input_attribute_data_type("A", component, CD_PROP_BOOL),
+ params.get_input_attribute_data_type("B", component, CD_PROP_BOOL),
+ params.get_input_attribute_data_type("Result", component, CD_PROP_BOOL),
+ });
+
+ /* Once we support more domains at the user level, we have to decide how the result domain is
+ * chosen. */
AttributeDomain result_domain = ATTR_DOMAIN_POINT;
-
- /* Use type and domain from the result attribute, if it exists already. */
const std::string result_name = params.get_input<std::string>("Result");
const ReadAttributePtr result_attribute_read = component.attribute_try_get_for_read(result_name);
if (result_attribute_read) {
- result_type = result_attribute_read->custom_data_type();
result_domain = result_attribute_read->domain();
}