[Bf-blender-cvs] [302584bd6ee] blender-v3.2-release: Fix T97831: Curve to mesh node can create invalid wire mesh

Hans Goudey noreply at git.blender.org
Wed May 4 12:27:11 CEST 2022


Commit: 302584bd6eef7ff4e37d31974302f2d6ce2174cb
Author: Hans Goudey
Date:   Wed May 4 12:26:59 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB302584bd6eef7ff4e37d31974302f2d6ce2174cb

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.

===================================================================

M	source/blender/blenkernel/BKE_curves.hh

===================================================================

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)



More information about the Bf-blender-cvs mailing list