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>2008-11-02 14:01:45 +0300
committerJoshua Leung <aligorith@gmail.com>2008-11-02 14:01:45 +0300
commit72ae88530d53c35e28b3677de0d77c90bb56078f (patch)
tree44bc5a749a5f8b692faa0f06800f1bc60d8e29e0
parent43399a6b012aad46018113e6c19806ef8a6d3856 (diff)
AnimSys2: Eulers for Bones Bugfixes
* AutoIK did not work with euler rotations yet. The conversions were still only being done for quats. * Fixed spelling errors in tooltips
-rw-r--r--source/blender/src/drawview.c4
-rw-r--r--source/blender/src/transform_conversions.c19
2 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index f1626d5ec8c..5b0d6515ca5 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -2061,8 +2061,8 @@ static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim)
/* rotation mode */
uiBlockBeginAlign(block);
- uiDefButS(block, ROW, B_ARMATUREPANEL3, "Quaternion",160,110,70,19, &pchan->rotmode, 70, PCHAN_ROT_QUAT, 0, 0, "Rotations calculated using Quaternions (4 components, no Gimble Lock, hard to edit)");
- uiDefButS(block, ROW, B_ARMATUREPANEL3, "Euler",230,110,70,19, &pchan->rotmode, 70, PCHAN_ROT_EUL, 0, 0, "Rotations calculated using Eulers (3 components, suffers from Gimble Lock, 'easy' to edit)");
+ uiDefButS(block, ROW, B_ARMATUREPANEL3, "Quaternion",160,110,70,19, &pchan->rotmode, 70, PCHAN_ROT_QUAT, 0, 0, "Rotations calculated using Quaternions (4 components, no Gimbal Lock, hard to edit)");
+ uiDefButS(block, ROW, B_ARMATUREPANEL3, "Euler",230,110,70,19, &pchan->rotmode, 70, PCHAN_ROT_EUL, 0, 0, "Rotations calculated using Eulers (3 components, suffers from Gimbal Lock, 'easy' to edit)");
uiBlockEndAlign(block);
if (pchan->rotmode) {
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 7ee6deba2f5..52ce5b992de 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -488,7 +488,7 @@ static short apply_targetless_ik(Object *ob)
}
else {
Mat4CpyMat3(tmat, bone->bone_mat);
-
+
VECCOPY(tmat[3], bone->head);
Mat4Invert(imat, tmat);
}
@@ -497,18 +497,25 @@ static short apply_targetless_ik(Object *ob)
/* apply and decompose, doesn't work for constraints or non-uniform scale well */
{
- float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3];
+ float rmat3[3][3], qrmat[3][3], imat[3][3], smat[3][3];
Mat3CpyMat4(rmat3, rmat);
- /* quaternion */
- Mat3ToQuat(rmat3, parchan->quat);
+ /* rotation */
+ if (parchan->rotmode)
+ Mat3ToEul(rmat3, parchan->eul);
+ else
+ Mat3ToQuat(rmat3, parchan->quat);
/* for size, remove rotation */
/* causes problems with some constraints (so apply only if needed) */
if (data->flag & CONSTRAINT_IK_STRETCH) {
- QuatToMat3(parchan->quat, qmat);
- Mat3Inv(imat, qmat);
+ if (parchan->rotmode)
+ EulToMat3(parchan->eul, qrmat);
+ else
+ QuatToMat3(parchan->quat, qrmat);
+
+ Mat3Inv(imat, qrmat);
Mat3MulMat3(smat, rmat3, imat);
Mat3ToSize(smat, parchan->size);
}