From 302584bd6eef7ff4e37d31974302f2d6ce2174cb Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 4 May 2022 12:26:59 +0200 Subject: Fix T97831: Curve to mesh node can create invalid wire mesh When the profile only has one control point, its segment count was determined incorrectly. There needs to be a special case for a single control point, when there are no segments even if the curve is cyclic. --- source/blender/blenkernel/BKE_curves.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh index fe2c6196221..1e96c0e4c41 100644 --- a/source/blender/blenkernel/BKE_curves.hh +++ b/source/blender/blenkernel/BKE_curves.hh @@ -412,7 +412,7 @@ namespace curves { inline int curve_segment_size(const int points_num, const bool cyclic) { BLI_assert(points_num > 0); - return cyclic ? points_num : points_num - 1; + return (cyclic && points_num > 1) ? points_num : points_num - 1; } inline float2 encode_surface_bary_coord(const float3 &v) -- cgit v1.2.3