diff options
author | Vitor Boschi <vitorboschi> | 2021-10-01 02:27:58 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-01 02:27:58 +0300 |
commit | 3a59ddb2927cc5b507fd5f071c6c1831dce743c4 (patch) | |
tree | 25661fbf41fe4e210f2417ccafe4ffcfe49d8951 | |
parent | 66fe1c79f3ce225da5d237ac1371e26920c9cb56 (diff) |
Fix: Incorrect warning in curve to mesh node with instances
The node was setting a warning when used with instances on input,
even though it worked fine.
Differential Revision: https://developer.blender.org/D12718
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc index b123820989f..9b4b6cdcd0c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_mesh.cc @@ -33,17 +33,8 @@ static void geo_node_curve_to_mesh_declare(NodeDeclarationBuilder &b) } static void geometry_set_curve_to_mesh(GeometrySet &geometry_set, - const GeometrySet &profile_set, - const GeoNodeExecParams ¶ms) + const GeometrySet &profile_set) { - if (!geometry_set.has_curve()) { - if (!geometry_set.is_empty()) { - params.error_message_add(NodeWarningType::Warning, - TIP_("No curve data available in curve input")); - } - return; - } - const CurveEval *profile_curve = profile_set.get_curve_for_read(); if (profile_curve == nullptr) { @@ -73,11 +64,20 @@ static void geo_node_curve_to_mesh_exec(GeoNodeExecParams params) TIP_("No curve data available in the profile input")); } + bool has_curve = false; curve_set.modify_geometry_sets([&](GeometrySet &geometry_set) { - geometry_set_curve_to_mesh(geometry_set, profile_set, params); + if (geometry_set.has_curve()) { + has_curve = true; + geometry_set_curve_to_mesh(geometry_set, profile_set); + } geometry_set.keep_only({GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_INSTANCES}); }); + if (!has_curve && !curve_set.is_empty()) { + params.error_message_add(NodeWarningType::Warning, + TIP_("No curve data available in curve input")); + } + params.set_output("Mesh", std::move(curve_set)); } |