Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-07-23 00:11:26 +0300
committerHans Goudey <h.goudey@me.com>2021-07-23 00:11:26 +0300
commit524d172742ec22ca04f2b0c83932e2cda669837c (patch)
tree66825a8d1917c35af281c6f8d851733357dfe31f /source/blender/nodes
parentf013e3de81dad88fdcc9b907f4804e84938d9561 (diff)
Fix: "Bake" automatically calculated handles in set handle node
Because these handles are calculated lazily, we need to make sure they are calculated before switching to a manually positioned mode. I doubt it would ever be necessary, but theoretically this could happen on a per-point level, to avoid calculating handles not in the selection.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_set_handles.cc6
1 files changed, 6 insertions, 0 deletions
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]) {