Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-05-04 13:26:59 +0300
committerHans Goudey <h.goudey@me.com>2022-05-04 13:26:59 +0300
commit302584bd6eef7ff4e37d31974302f2d6ce2174cb (patch)
treebebba98fe2423afce501533c9beb47185595bd17 /source
parent79e94caa6bf9fac819f7ba1c225adaf7bb67ec87 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_curves.hh2
1 files changed, 1 insertions, 1 deletions
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)