PoseChannel Transforms - AutoIK Restored

- Auto-IK works again now. 

- Quick-animate feature works with Auto-IK now. 
- Also disabled the checks for existing animation data for this, making it easier to use/discover. At least we've got undo to cover for the cases where the user didn't intend to do this.
This commit is contained in:
2009-02-17 09:34:21 +00:00
parent e81fde5aa4
commit 6eae888d49
2 changed files with 9 additions and 11 deletions

View File

@@ -125,6 +125,7 @@
#include "ED_image.h"
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h"
#include "ED_object.h"
#include "ED_mesh.h"
#include "ED_types.h"
#include "ED_uvedit.h"
@@ -835,18 +836,17 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
if(data->tar==NULL || (data->tar->type==OB_ARMATURE && data->subtarget[0]==0)) {
targetless = con;
/* but, if this is a targetless IK, we make it auto anyway (for the children loop) */
if (con->enforce!=0.0) {
if (con->enforce!=0.0f) {
targetless->flag |= CONSTRAINT_IK_AUTO;
return 0;
}
}
if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0))
if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0f))
return 0;
}
}
// TRANSFORM_FIX_ME
//con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC);
con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC);
BLI_addtail(&pchan->constraints, con);
pchan->constflag |= (PCHAN_HAS_IK|PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */
data= con->data;
@@ -965,7 +965,6 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob)
if (arm->flag & ARM_RESTPOS) {
if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE)==0) {
//notice("Pose edit not possible while Rest Position is enabled");
BKE_report(CTX_reports(C), RPT_ERROR, "Can't select linked when sync selection is enabled.");
return;
}
@@ -1004,7 +1003,6 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob)
}
if(td != (t->data+t->total)) {
// printf("Bone selection count error\n");
BKE_report(CTX_reports(C), RPT_DEBUG, "Bone selection count error.");
}

View File

@@ -565,10 +565,10 @@ void recalcData(TransInfo *t)
* check if the auto-record feature means that we should record 'samples'
* (i.e. uneditable animation values)
*/
// XXX experimental feature
// TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
if ((ob->adt) && (t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
short targetless_ik= 0; // XXX...
// TODO: maybe the ob->adt check isn't really needed? makes it too difficult to use...
if (/*(ob->adt) && */(t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
short targetless_ik= (t->flag & T_AUTOIK);
autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik);
}
@@ -593,9 +593,9 @@ void recalcData(TransInfo *t)
* check if the auto-record feature means that we should record 'samples'
* (i.e. uneditable animation values)
*/
// XXX experimental feature
// TODO: autokeyframe calls need some setting to specify to add samples (FPoints) instead of keyframes?
if ((ob->adt) && (t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
// TODO: maybe the ob->adt check isn't really needed? makes it too difficult to use...
if (/*(ob->adt) && */(t->animtimer) && IS_AUTOKEY_ON(t->scene)) {
autokeyframe_ob_cb_func(t->scene, (View3D *)t->view, ob, t->mode);
}