[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51612] trunk/blender/source/blender/ blenkernel/intern/constraint.c: Cleanup: remove old, commented code for constraints' space conversion for bones.

Bastien Montagne montagne29 at wanadoo.fr
Thu Oct 25 12:14:36 CEST 2012


Revision: 51612
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51612
Author:   mont29
Date:     2012-10-25 10:14:35 +0000 (Thu, 25 Oct 2012)
Log Message:
-----------
Cleanup: remove old, commented code for constraints' space conversion for bones.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/constraint.c

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-10-25 08:48:05 UTC (rev 51611)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-10-25 10:14:35 UTC (rev 51612)
@@ -221,51 +221,6 @@
 
 /* -------------- Space-Conversion API -------------- */
 
-#if 0 /* XXX Old code, does the same as one in armature.c, will remove it later. */
-static void constraint_pchan_diff_mat(bPoseChannel *pchan, float diff_mat[4][4])
-{
-	if (pchan->parent) {
-		float offs_bone[4][4];
-
-		/* construct offs_bone the same way it is done in armature.c */
-		copy_m4_m3(offs_bone, pchan->bone->bone_mat);
-		copy_v3_v3(offs_bone[3], pchan->bone->head);
-		offs_bone[3][1] += pchan->bone->parent->length;
-
-		if (pchan->bone->flag & BONE_HINGE) {
-			/* pose_mat = par_pose-space_location * chan_mat */
-			float tmat[4][4];
-
-			/* the rotation of the parent restposition */
-			copy_m4_m4(tmat, pchan->bone->parent->arm_mat);
-
-			/* the location of actual parent transform */
-			copy_v3_v3(tmat[3], offs_bone[3]);
-			zero_v3(offs_bone[3]);
-			mul_m4_v3(pchan->parent->pose_mat, tmat[3]);
-
-			mult_m4_m4m4(diff_mat, tmat, offs_bone);
-		}
-		else {
-			/* pose_mat = par_pose_mat * bone_mat * chan_mat */
-			if (pchan->bone->flag & BONE_NO_SCALE) {
-				float tmat[4][4];
-				copy_m4_m4(tmat, pchan->parent->pose_mat);
-				normalize_m4(tmat);
-				mult_m4_m4m4(diff_mat, tmat, offs_bone);
-			}
-			else {
-				mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone);
-			}
-		}
-	}
-	else {
-		/* pose_mat = chan_mat * arm_mat */
-		copy_m4_m4(diff_mat, pchan->bone->arm_mat);
-	}
-}
-#endif
-
 /* This function is responsible for the correct transformations/conversions 
  * of a matrix from one space to another for constraint evaluation.
  * For now, this is only implemented for Objects and PoseChannels.
@@ -307,18 +262,6 @@
 				else if (to == CONSTRAINT_SPACE_LOCAL) {
 					if (pchan->bone) {
 						BKE_armature_mat_pose_to_bone(pchan, mat, mat);
-#if 0  /* XXX Old code, will remove it later. */
-						constraint_pchan_diff_mat(pchan, diff_mat);
-
-						invert_m4_m4(imat, diff_mat);
-						mult_m4_m4m4(mat, imat, mat);
-
-						/* override with local location */
-						if ((pchan->parent) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) {
-							BKE_armature_mat_pose_to_bone_ex(ob, pchan, pchan->pose_mat, tempmat);
-							copy_v3_v3(mat[3], tempmat[3]);
-						}
-#endif
 					}
 				}
 				/* pose to local with parent */
@@ -336,11 +279,6 @@
 				if (pchan->bone) {
 					/* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */
 					BKE_armature_mat_bone_to_pose(pchan, mat, mat);
-#if 0
-					constraint_pchan_diff_mat(pchan, diff_mat);
-
-					mult_m4_m4m4(mat, diff_mat, mat);
-#endif
 				}
 				
 				/* use pose-space as stepping stone for other spaces */




More information about the Bf-blender-cvs mailing list