diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-23 23:44:55 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-23 23:44:55 +0300 |
commit | f8fe0e831ec14cc521e03df6b586918a6a5add03 (patch) | |
tree | 4d9c311e5416000f6ddca14662fd00b766a64f20 /source/blender/blenkernel/intern | |
parent | 756f7fb23e2b3ed1ec877a3bf6e0d9812271e491 (diff) |
Curves: Use simpler "set" behavior for handle position attributes
The handle position attributes `handle_left` and `handle_right` had
rather complex behavior to get expected behavior when aligned or auto/
vector handles were used. In order to simplify the attribtue API and
make the transition to the new curves data structure simpler, this
commit moves that behavior from the attribute to the "Set Handle
Positions" node. When that node is used, the behavior should be the
same as before. However, if the modifier's output attributes were used
to set handle positions, the behavior may be different. That situation
is expected to be very rare though.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_curve.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index 2004f1c0609..9116ffc63a8 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -973,10 +973,10 @@ class VArrayImpl_For_BezierHandles final : public VMutableArrayImpl<float3> { if (spline.type() == CURVE_TYPE_BEZIER) { BezierSpline &bezier_spline = static_cast<BezierSpline &>(spline); if (is_right_) { - bezier_spline.set_handle_position_right(indices.point_index, value); + bezier_spline.handle_positions_right()[indices.point_index] = value; } else { - bezier_spline.set_handle_position_left(indices.point_index, value); + bezier_spline.handle_positions_left()[indices.point_index] = value; } bezier_spline.mark_cache_invalid(); } @@ -992,12 +992,12 @@ class VArrayImpl_For_BezierHandles final : public VMutableArrayImpl<float3> { BezierSpline &bezier_spline = static_cast<BezierSpline &>(spline); if (is_right_) { for (const int i : IndexRange(bezier_spline.size())) { - bezier_spline.set_handle_position_right(i, src[offset + i]); + bezier_spline.handle_positions_right()[i] = src[offset + i]; } } else { for (const int i : IndexRange(bezier_spline.size())) { - bezier_spline.set_handle_position_left(i, src[offset + i]); + bezier_spline.handle_positions_left()[i] = src[offset + i]; } } bezier_spline.mark_cache_invalid(); |