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
path: root/source
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2022-01-12 14:03:26 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-17 16:24:12 +0300
commitfb21201d4244e3bd8f9c01fece2cb14e0ae29d2d (patch)
treead4f285fdb0518fe48069ec5f9f80b79f7455796 /source
parent49f25ae23ce8570b0aa7df07a5ed53ecf835f933 (diff)
Fix T94837: curve tilt on a 2-point-curve is wrong
2-point-curves are treated separately from 3plus-point-curves (assume a lot of the twisting reduction can be skipped, so there is a dedicated function for single segment curves). And while using the 3plus-point-curves function [`make_bevel_list_3D`] would actually work in this case, the dedicated function `make_bevel_list_segment_3D` would only consider the tilt of the second point and would just copy over the quat to the first point as well. Dont see a reason for this, now consider the first point's tilt as well. Maniphest Tasks: T94837 Differential Revision: https://developer.blender.org/D13813
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/curve.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 577e6758459..37cd62c3bc8 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -2524,12 +2524,15 @@ static void make_bevel_list_segment_3D(BevList *bl)
normalize_v3(bevp1->dir);
vec_to_quat(bevp1->quat, bevp1->dir, 5, 1);
-
axis_angle_to_quat(q, bevp1->dir, bevp1->tilt);
mul_qt_qtqt(bevp1->quat, q, bevp1->quat);
normalize_qt(bevp1->quat);
+
copy_v3_v3(bevp2->dir, bevp1->dir);
- copy_qt_qt(bevp2->quat, bevp1->quat);
+ vec_to_quat(bevp2->quat, bevp2->dir, 5, 1);
+ axis_angle_to_quat(q, bevp2->dir, bevp2->tilt);
+ mul_qt_qtqt(bevp2->quat, q, bevp2->quat);
+ normalize_qt(bevp2->quat);
}
/* only for 2 points */