Geometry Nodes: Add mesh input warning to curve to mesh node

A point of confusion about this node is that it doesn't work on the
output of the mesh circle primitive node. This patch adds a warning to
help with that. This avoids adding a warning when the geometry set
input has no mesh.

Differential Revision: https://developer.blender.org/D11771
This commit is contained in:
Hans Goudey 2021-07-02 13:24:42 -05:00
parent 00e30f122b
commit 55f27617cf
1 changed files with 10 additions and 0 deletions

View File

@ -337,7 +337,17 @@ static void geo_node_curve_to_mesh_exec(GeoNodeExecParams params)
curve_set = bke::geometry_set_realize_instances(curve_set);
profile_set = bke::geometry_set_realize_instances(profile_set);
/* Note: Theoretically an "is empty" check would be more correct for errors. */
if (profile_set.has_mesh() && !profile_set.has_curve()) {
params.error_message_add(NodeWarningType::Warning,
TIP_("No curve data available in profile input"));
}
if (!curve_set.has_curve()) {
if (curve_set.has_mesh()) {
params.error_message_add(NodeWarningType::Warning,
TIP_("No curve data available in curve input"));
}
params.set_output("Mesh", GeometrySet());
return;
}