From 4f73d43adc38a54c8b033ca3e91e9d61e927b665 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Mon, 13 Sep 2021 12:41:33 -0300 Subject: Fix T90736: Problem applying scale to curves Curve Points of handle of type `Auto` on curves not uniformly scaled cause the shape of the curve to be modified after applying the scale. So change these handles to `Aligned` in these cases. Reviewed By: campbellbarton Maniphest Tasks: T90736 Differential Revision: https://developer.blender.org/D12281 --- source/blender/blenkernel/intern/curve.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/intern/curve.c') diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 397838e6904..f22c3b13efc 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -5269,6 +5269,8 @@ void BKE_curve_transform_ex(Curve *cu, BezTriple *bezt; int i; + const bool is_uniform_scaled = is_uniform_scaled_m4(mat); + LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) { if (nu->type == CU_BEZIER) { i = nu->pntsu; @@ -5279,6 +5281,11 @@ void BKE_curve_transform_ex(Curve *cu, if (do_props) { bezt->radius *= unit_scale; } + if (!is_uniform_scaled) { + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) || ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM)) { + bezt->h1 = bezt->h2 = HD_ALIGN; + } + } } BKE_nurb_handles_calc(nu); } -- cgit v1.2.3