diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-08-31 11:33:27 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-08-31 11:33:27 +0400 |
commit | 6aee42daaf88ba542c2a162bf0998f31ce2b488c (patch) | |
tree | d1a286f5114e3ce1fac860377f5c353c73f0b0bb | |
parent | 9818b8a95c49296218870ab2ad784f0fe55fe5d7 (diff) |
Bugfix #17551: AutoKey for Visual Keying non-functional
No VisualKeying checks were being done
-rw-r--r-- | source/blender/src/transform_conversions.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index efb86b59ed1..0b43dac07cf 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -3751,6 +3751,35 @@ void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik) insertkey_smarter(id, ID_PO, pchan->name, NULL, AC_SIZE_Z); } } + else if (IS_AUTOKEY_FLAG(AUTOMATKEY)) { + int matok=0; + + /* check one to make sure we're not trying to set visual loc keys on + bones inside of a chain, which only leads to tears. */ + matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_X); + insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y); + insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z); + + if (matok == 0) { + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); + } + + /* check one to make sure we're not trying to set visual rot keys on + bones inside of a chain, which only leads to tears. */ + matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W); + insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X); + insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); + insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); + + if (matok == 0) { + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); + } + } /* insert keyframe in any channel that's appropriate */ else { insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); |