[Bf-blender-cvs] [4f73d43adc3] master: Fix T90736: Problem applying scale to curves

Germano Cavalcante noreply at git.blender.org
Mon Sep 13 17:45:32 CEST 2021


Commit: 4f73d43adc38a54c8b033ca3e91e9d61e927b665
Author: Germano Cavalcante
Date:   Mon Sep 13 12:41:33 2021 -0300
Branches: master
https://developer.blender.org/rB4f73d43adc38a54c8b033ca3e91e9d61e927b665

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

===================================================================

M	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);
     }



More information about the Bf-blender-cvs mailing list