From 888b879f5f4ea8ef5f01d466ab0871b48c8f0a95 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 12 Nov 2021 13:25:22 -0600 Subject: Fix: Incorrect transfer attribute error message with curves The node does support curves, but only in index mode (see T88630) So add a specific error message for the nearest mode, and let the node support curves in the declaration. Differential Revision: https://developer.blender.org/D13205 --- source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc index f1b100c15d0..9754b3f81a0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc @@ -42,7 +42,8 @@ static void geo_node_transfer_attribute_declare(NodeDeclarationBuilder &b) { b.add_input(N_("Target")) .only_realized_data() - .supported_type({GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD}); + .supported_type( + {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}); b.add_input(N_("Attribute")).hide_value().supports_field(); b.add_input(N_("Attribute"), "Attribute_001").hide_value().supports_field(); @@ -769,6 +770,8 @@ static void geo_node_transfer_attribute_exec(GeoNodeExecParams params) } case GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST: { if (geometry.has_curve() && !geometry.has_mesh() && !geometry.has_pointcloud()) { + params.error_message_add(NodeWarningType::Error, + TIP_("The target geometry must contain a mesh or a point cloud")); return return_default(); } auto fn = std::make_unique( -- cgit v1.2.3