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
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/constraint.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 974d536d83e..bc918df84ed 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -1833,8 +1833,14 @@ static void rotlike_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar
/* To allow compatible rotations, must get both rotations in the order of the owner... */
mat4_to_eulO(obeul, rot_order, cob->matrix);
/* We must get compatible eulers from the beginning because
- * some of them can be modified below (see bug T21875). */
- mat4_to_compatible_eulO(eul, obeul, rot_order, ct->matrix);
+ * some of them can be modified below (see bug T21875).
+ * Additionally, since this constraint is based on euler rotation math, it doesn't work well with shear.
+ * The Y axis is chosen as the main axis when we orthoganalize the matrix because constraints are
+ * used most commonly on bones. */
+ float mat[4][4];
+ copy_m4_m4(mat, ct->matrix);
+ orthogonalize_m4_stable(mat, 1, true);
+ mat4_to_compatible_eulO(eul, obeul, rot_order, mat);
/* Prepare the copied euler rotation. */
bool legacy_offset = false;