diff options
-rw-r--r-- | source/blender/blenkernel/BKE_spline.hh | 3 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh index f85e62768f7..8f21ca01f31 100644 --- a/source/blender/blenkernel/BKE_spline.hh +++ b/source/blender/blenkernel/BKE_spline.hh @@ -306,6 +306,7 @@ class BezierSpline final : public Spline { blender::MutableSpan<HandleType> handle_types_right(); blender::Span<blender::float3> handle_positions_right() const; blender::MutableSpan<blender::float3> handle_positions_right(); + void ensure_auto_handles() const; void translate(const blender::float3 &translation) override; void transform(const blender::float4x4 &matrix) override; @@ -353,8 +354,6 @@ class BezierSpline final : public Spline { void correct_end_tangents() const final; void copy_settings(Spline &dst) const final; void copy_data(Spline &dst) const final; - - void ensure_auto_handles() const; }; /** diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc index 96987df9de3..72bd8ab188d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc @@ -101,6 +101,12 @@ static void geo_node_curve_set_handles_exec(GeoNodeExecParams params) } BezierSpline &bezier_spline = static_cast<BezierSpline &>(*spline); + if (ELEM(new_handle_type, BezierSpline::HandleType::Free, BezierSpline::HandleType::Align)) { + /* In this case the automatically calculated handle types need to be "baked", because + * they're possibly changing from a type that is calculated automatically to a type that + * is positioned manually. */ + bezier_spline.ensure_auto_handles(); + } has_bezier_spline = true; for (int i_point : IndexRange(bezier_spline.size())) { if (selection[point_index]) { |