[Bf-blender-cvs] [8c3f4f7edf9] master: Fix: Incorrect node bezier spline tangent calculation for end points
Hans Goudey
noreply at git.blender.org
Wed Jun 9 06:52:38 CEST 2021
Commit: 8c3f4f7edf9d9769f07291d64bc22fa85e210e86
Author: Hans Goudey
Date: Tue Jun 8 23:52:29 2021 -0500
Branches: master
https://developer.blender.org/rB8c3f4f7edf9d9769f07291d64bc22fa85e210e86
Fix: Incorrect node bezier spline tangent calculation for end points
The code was using the useless dangling handle at each end of the spline
rather than the handle pointing inwards.
===================================================================
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 3c6cf2c78cf..3e421dcfc13 100644
--- a/source/blender/blenkernel/intern/spline_bezier.cc
+++ b/source/blender/blenkernel/intern/spline_bezier.cc
@@ -317,11 +317,11 @@ void BezierSpline::correct_end_tangents() const
MutableSpan<float3> tangents(evaluated_tangents_cache_);
- if (handle_positions_left_.first() != positions_.first()) {
- tangents.first() = (positions_.first() - handle_positions_left_.first()).normalized();
+ if (handle_positions_right_.first() != positions_.first()) {
+ tangents.first() = (handle_positions_right_.first() - positions_.first()).normalized();
}
- if (handle_positions_right_.last() != positions_.last()) {
- tangents.last() = (handle_positions_right_.last() - positions_.last()).normalized();
+ if (handle_positions_left_.last() != positions_.last()) {
+ tangents.last() = (positions_.last() - handle_positions_left_.last()).normalized();
}
}
More information about the Bf-blender-cvs
mailing list