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:
authorJoshua Leung <aligorith@gmail.com>2015-10-26 05:14:02 +0300
committerJoshua Leung <aligorith@gmail.com>2015-10-26 10:18:11 +0300
commit0860fdc53cca53441ca9d9d55a30878d9cdda725 (patch)
treee479ce7e7f7f9c5f76b6e0e94ff3c20dbcbf67b6 /source/blender/blenkernel/intern/constraint.c
parent65072499c65affaf26e2e6912129387ba54211f1 (diff)
Fix T46599: Copy Rotation behaves erratically when Use Y is disabled
When the "Use Y" option in the Copy Rotation constraint is disabled, the constraint behaves eratically when rotating all the target on all axes at the same time. This is partially to be expected due to the way that euler rotations work (i.e. the rotation orders stuff - you should use a rotation order based on most to least important/significant rotations). Hence, by locking Y, you're causing accuracy problems for Z. What was not expected though was that changing the rotation orders on the objects involved (for the record, it's the constraint owner that counts) did nothing. It turns out that for objects, the rotation order settings were getting ignored! This commit fixes this problem, and this particular case can be resolved by using "XZY". Notes: * Since all object constraints were previously working on the assumption that they used XYZ (default) order, it is possible that this change may have the unintended consequence of changing the behaviour of some rigs which relied on the buggy behaviour. Hopefully this will be a rare occurrence.
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 906a9e4e484..85383cc8cf1 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -133,7 +133,20 @@ bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subda
if (ob) {
cob->ob = ob;
cob->type = datatype;
- cob->rotOrder = EULER_ORDER_DEFAULT; // TODO: when objects have rotation order too, use that
+
+ if (cob->ob->rotmode > 0) {
+ /* Should be some kind of Euler order, so use it */
+ /* NOTE: Versions <= 2.76 assumed that "default" order
+ * would always get used, so we may seem some rig
+ * breakage as a result. However, this change here
+ * is needed to fix T46599
+ */
+ cob->rotOrder = ob->rotmode;
+ }
+ else {
+ /* Quats/Axis-Angle, so Eulers should just use default order */
+ cob->rotOrder = EULER_ORDER_DEFAULT;
+ }
copy_m4_m4(cob->matrix, ob->obmat);
}
else