[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19003] branches/blender2.5/blender/source /blender/editors/transform: PoseChannel Transforms - AutoIK Restored

Joshua Leung aligorith at gmail.com
Tue Feb 17 10:34:44 CET 2009


Revision: 19003
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19003
Author:   aligorith
Date:     2009-02-17 10:34:21 +0100 (Tue, 17 Feb 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c

Modified: branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c	2009-02-17 08:55:50 UTC (rev 19002)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c	2009-02-17 09:34:21 UTC (rev 19003)
@@ -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 @@
 			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 @@
 	
 	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 @@
 	}
 	
 	if(td != (t->data+t->total)) {
-		// printf("Bone selection count error\n");
 		BKE_report(CTX_reports(C), RPT_DEBUG, "Bone selection count error.");
 	}
 	

Modified: branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c	2009-02-17 08:55:50 UTC (rev 19002)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c	2009-02-17 09:34:21 UTC (rev 19003)
@@ -565,10 +565,10 @@
 		 * 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 @@
 			 * 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);
 			}
 			





More information about the Bf-blender-cvs mailing list