diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-23 22:01:20 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-23 22:01:20 +0300 |
commit | 81e89a444ef744b89726b21fc4cfbec3389c711f (patch) | |
tree | 7fbd8a9d23f70fc7a7fc96cfe2b3692611667349 /source/blender/nodes/geometry | |
parent | 7518adc5bbe25ab8fbac9d42ccf865e6538e044a (diff) | |
parent | dbef66c32f728546c6b0a1759a38e7edd9fa4dfc (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/nodes/geometry')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc index 69f43c81ea3..1d006aea1ef 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_bezier_segment.cc @@ -77,13 +77,22 @@ static std::unique_ptr<CurveEval> create_bezier_segment_curve( positions.first() = start; positions.last() = end; + MutableSpan<float3> handles_right = spline->handle_positions_right(); + MutableSpan<float3> handles_left = spline->handle_positions_left(); + if (mode == GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT_POSITION) { - spline->set_handle_position_right(0, start_handle_right); - spline->set_handle_position_left(1, end_handle_left); + handles_left.first() = 2.0f * start - start_handle_right; + handles_right.first() = start_handle_right; + + handles_left.last() = end_handle_left; + handles_right.last() = 2.0f * end - end_handle_left; } else { - spline->set_handle_position_right(0, start + start_handle_right); - spline->set_handle_position_left(1, end + end_handle_left); + handles_left.first() = start - start_handle_right; + handles_right.first() = start + start_handle_right; + + handles_left.last() = end + end_handle_left; + handles_right.last() = end - end_handle_left; } curve->add_spline(std::move(spline)); |