[Bf-blender-cvs] [e46b9de6abb] master: Fix: Curve to mesh node assert when last profile segment is vector

Hans Goudey noreply at git.blender.org
Sat May 8 01:16:21 CEST 2021


Commit: e46b9de6abbeb30f3267f656148c281b40cfad8e
Author: Hans Goudey
Date:   Fri May 7 18:16:15 2021 -0500
Branches: master
https://developer.blender.org/rBe46b9de6abbeb30f3267f656148c281b40cfad8e

Fix: Curve to mesh node assert when last profile segment is vector

We need to always add a single point to the last cyclic segment that
completes the loop, because that includes the starting point of the
evaluated edge. The existing code forgot about that point.

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

M	source/blender/blenkernel/intern/spline_bezier.cc

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

diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc
index 4d4e1b386c4..20226dc3ed2 100644
--- a/source/blender/blenkernel/intern/spline_bezier.cc
+++ b/source/blender/blenkernel/intern/spline_bezier.cc
@@ -204,7 +204,7 @@ int BezierSpline::evaluated_points_size() const
 
   const int last_offset = this->control_point_offsets().last();
   if (is_cyclic_ && points_len > 1) {
-    return last_offset + (this->segment_is_vector(points_len - 1) ? 0 : resolution_);
+    return last_offset + (this->segment_is_vector(points_len - 1) ? 1 : resolution_);
   }
 
   return last_offset + 1;



More information about the Bf-blender-cvs mailing list