From 623ff64a278924af57d7e1ec7e7bdb8792a560f8 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Fri, 4 Feb 2022 14:19:44 +0100 Subject: Fix T81541: Symmetrize Transform Constraint, Y rotational axis unexpected results The case where Y rotation is mapped to Y rotation was not handled. This is now fixed. Also added an automated test to make sure that the symmetrize operator functions as intended. Reviewed By: Sybren Differential Revision: http://developer.blender.org/D9214 --- source/blender/editors/armature/armature_add.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index 02ecfdb4ea6..4a327904ddd 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -581,8 +581,6 @@ static void updateDuplicateLocRotConstraintSettings(Object *ob, { /* This code assumes that bRotLimitConstraint and bLocLimitConstraint have the same fields in * the same memory locations. */ - BLI_assert(sizeof(bLocLimitConstraint) == sizeof(bRotLimitConstraint)); - bRotLimitConstraint *limit = (bRotLimitConstraint *)curcon->data; float local_mat[4][4], imat[4][4]; @@ -798,6 +796,13 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, trans->to_min_rot[i] = temp_vec[i]; } } + + if (trans->from == TRANS_ROTATION && trans->map[1] == Y) { + /* Y Rot to Y Rot: Flip and invert */ + trans->to_max_rot[1] = -trans->to_min_rot[1]; + trans->to_min_rot[1] = -temp_vec[1]; + } + break; } /* convert back to the settings space */ -- cgit v1.2.3