diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2022-02-04 16:19:44 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2022-02-04 16:21:20 +0300 |
commit | 623ff64a278924af57d7e1ec7e7bdb8792a560f8 (patch) | |
tree | 889a50d215cd1d98b0d7a87fa3d25e32a3aa142e /source/blender/editors/armature/armature_add.c | |
parent | 0dd3e77d7177cbf75a1370e594020c02e48cfa10 (diff) |
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
Diffstat (limited to 'source/blender/editors/armature/armature_add.c')
-rw-r--r-- | source/blender/editors/armature/armature_add.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 */ |