[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34312] trunk/blender/source/blender/ editors/transform/transform_conversions.c: Reverting r33930 and r34202, which were related to bugs #21825 and

Joshua Leung aligorith at gmail.com
Fri Jan 14 00:53:14 CET 2011


Revision: 34312
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34312
Author:   aligorith
Date:     2011-01-13 23:53:14 +0000 (Thu, 13 Jan 2011)
Log Message:
-----------
Reverting r33930 and r34202, which were related to bugs #21825 and
#25554. As found by Daniel Lara (Pepeland) in #25554, the original
problems in #21825 all stemmed from the ChildOf constraint there
having an incorrect inverse set, which was altering the final results.

Now Auto-IK works nicely for old rigs again (i.e. FK arms on BBB rigs)

Revision Links:
--------------
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33930
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34202

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform_conversions.c

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c	2011-01-13 23:38:25 UTC (rev 34311)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c	2011-01-13 23:53:14 UTC (rev 34312)
@@ -711,9 +711,8 @@
 	for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 		bone = pchan->bone;
 		if(bone->flag & BONE_TRANSFORM) {
-
 			total++;
-
+			
 			if(mode == TFM_TRANSLATION) {
 				if( has_targetless_ik(pchan)==NULL ) {
 					if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
@@ -754,7 +753,7 @@
 	for (con= pchan->constraints.first; con; con= con->next) {
 		if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) {
 			bKinematicConstraint *data= con->data;
-
+			
 			/* only accept if a temporary one (for auto-ik) */
 			if (data->flag & CONSTRAINT_IK_TEMP) {
 				/* chainlen is new chainlen, but is limited by maximum chainlen */
@@ -803,8 +802,9 @@
 	for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
 		/* clear all temporary lock flags */
 		pchan->ikflag &= ~(BONE_IK_NO_XDOF_TEMP|BONE_IK_NO_YDOF_TEMP|BONE_IK_NO_ZDOF_TEMP);
-
+		
 		pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET);
+		
 		/* remove all temporary IK-constraints added */
 		for (con= pchan->constraints.first; con; con= next) {
 			next= con->next;
@@ -879,19 +879,6 @@
 			pchan = pchan->parent;
 		else
 			pchan = NULL;
-		
-		/* but, constrainted bones can't get auto-ik transform applied, exclude these */
-		if(pchan && pchan->constraints.first) {
-			/* if constraint is disabled or has no influence, OK then we allow :) */
-			for (con= pchan->constraints.first; con; con= con->next) {
-				if ((con->enforce==0.0f) || (con->flag & (CONSTRAINT_DISABLE|CONSTRAINT_OFF)));
-				else break;
-			}
-			if(con) {
-				data->rootbone--;
-				pchan= NULL;
-			}
-		}
 	}
 
 	/* make a copy of maximum chain-length */
@@ -3585,13 +3572,13 @@
 
 /* ------------------------ */
 
-/* struct for use in re-sorting BezTriples during IPO transform */
+/* struct for use in re-sorting BezTriples during Graph Editor transform */
 typedef struct BeztMap {
 	BezTriple *bezt;
-	int oldIndex; 		/* index of bezt in icu->bezt array before sorting */
-	int newIndex;		/* index of bezt in icu->bezt array after sorting */
-	short swapHs; 		/* swap order of handles (-1=clear; 0=not checked, 1=swap) */
-	char pipo, cipo;	/* interpolation of current and next segments */
+	unsigned int oldIndex; 		/* index of bezt in fcu->bezt array before sorting */
+	unsigned int newIndex;		/* index of bezt in fcu->bezt array after sorting */
+	short swapHs; 				/* swap order of handles (-1=clear; 0=not checked, 1=swap) */
+	char pipo, cipo;			/* interpolation of current and next segments */
 } BeztMap;
 
 
@@ -3722,11 +3709,11 @@
 			if (bezm->bezt->f2 & SELECT) {
 				if (td->loc2d == bezm->bezt->vec[1]) {
 					td->loc2d= (bezts + bezm->newIndex)->vec[1];
-
+					
 					/* if only control point is selected, the handle pointers need to be updated as well */
 					td->h1= (bezts + bezm->newIndex)->vec[0];
 					td->h2= (bezts + bezm->newIndex)->vec[2];
-
+					
 					adjusted[j] = 1;
 				}
 			}
@@ -3809,7 +3796,7 @@
 					break;
 			}
 		}
-
+		
 		/* we need to unapply the nla-mapping from the time in some situations */
 		if (adt)
 			td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], NLATIME_CONVERT_UNMAP);
@@ -3821,12 +3808,12 @@
 			td2d->loc2d[1]= (float)((int)td2d->loc[1]);
 		else
 			td2d->loc2d[1]= td2d->loc[1];
-
+		
 		if ((td->flag & TD_MOVEHANDLE1) && td2d->h1) {
 			td2d->h1[0] = td2d->ih1[0] + td->loc[0] - td->iloc[0];
 			td2d->h1[1] = td2d->ih1[1] + td->loc[1] - td->iloc[1];
 		}
-
+		
 		if ((td->flag & TD_MOVEHANDLE2) && td2d->h2) {
 			td2d->h2[0] = td2d->ih2[0] + td->loc[0] - td->iloc[0];
 			td2d->h2[1] = td2d->ih2[1] + td->loc[1] - td->iloc[1];




More information about the Bf-blender-cvs mailing list