diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-03 20:54:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-03 20:54:42 +0300 |
commit | 933d56d9e98d3bedd828abc6cea7d7e37fb7206b (patch) | |
tree | 596b40be314d8c22bbefeac6eb530976447c3e2c /source/blender/blenkernel/intern/curves_geometry.cc | |
parent | f6baba695cc0a7fb0efcd2586457466774e8f843 (diff) |
Curves: Support set origin and apply transform operators
Add support for the Curves object to the "Set Origin" and "Apply Object
Tansform" operators. Also change the automatic handle calculation to
avoid adding Bezier attributes if they don't need to be added.
Differential Revision: https://developer.blender.org/D14526
Diffstat (limited to 'source/blender/blenkernel/intern/curves_geometry.cc')
-rw-r--r-- | source/blender/blenkernel/intern/curves_geometry.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index b0a97bb0df8..552d7622932 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -772,6 +772,10 @@ void CurvesGeometry::calculate_bezier_auto_handles() if (types.is_single() && types.get_internal_single() != CURVE_TYPE_BEZIER) { return; } + if (std::as_const(*this).handle_positions_left().is_empty() || + std::as_const(*this).handle_positions_right().is_empty()) { + return; + } const VArray<bool> cyclic = std::as_const(*this).cyclic(); const Span<int8_t> types_left = this->handle_types_left(); const Span<int8_t> types_right = this->handle_types_right(); |