[Bf-blender-cvs] [332d547ab7b] master: Fix T99850: incorrect tangents on evaluated bezier curves
Jacques Lucke
noreply at git.blender.org
Mon Jul 25 13:10:51 CEST 2022
Commit: 332d547ab7bc99604b31f20cb300a38277629787
Author: Jacques Lucke
Date: Mon Jul 25 13:10:34 2022 +0200
Branches: master
https://developer.blender.org/rB332d547ab7bc99604b31f20cb300a38277629787
Fix T99850: incorrect tangents on evaluated bezier curves
Cyclic curves don't need the tangent correction based on the first
and last handle position.
===================================================================
M source/blender/blenkernel/intern/curves_geometry.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc
index 227ebc73c89..3050e01e528 100644
--- a/source/blender/blenkernel/intern/curves_geometry.cc
+++ b/source/blender/blenkernel/intern/curves_geometry.cc
@@ -715,8 +715,9 @@ Span<float3> CurvesGeometry::evaluated_tangents() const
}
});
- /* Correct the first and last tangents of Bezier curves so that they align with the inner
- * handles. This is a separate loop to avoid the cost when Bezier type curves are not used. */
+ /* Correct the first and last tangents of non-cyclic Bezier curves so that they align with the
+ * inner handles. This is a separate loop to avoid the cost when Bezier type curves are not
+ * used. */
Vector<int64_t> bezier_indices;
const IndexMask bezier_mask = this->indices_for_curve_type(CURVE_TYPE_BEZIER, bezier_indices);
if (!bezier_mask.is_empty()) {
@@ -726,6 +727,9 @@ Span<float3> CurvesGeometry::evaluated_tangents() const
threading::parallel_for(bezier_mask.index_range(), 1024, [&](IndexRange range) {
for (const int curve_index : bezier_mask.slice(range)) {
+ if (cyclic[curve_index]) {
+ continue;
+ }
const IndexRange points = this->points_for_curve(curve_index);
const IndexRange evaluated_points = this->evaluated_points_for_curve(curve_index);
More information about the Bf-blender-cvs
mailing list