[Bf-blender-cvs] [e27dcc3] master: Cleanup: no need to use constraint space transform API here, we can directly call BKE_armature_mat_pose_to_bone (and avoids the need to get an Object pointer!). Note the former just calls the later internally, in this case.

Bastien Montagne noreply at git.blender.org
Tue Jan 21 09:32:04 CET 2014


Commit: e27dcc3423d5cb9781074f5eb0afc00496759e36
Author: Bastien Montagne
Date:   Tue Jan 21 09:13:43 2014 +0100
https://developer.blender.org/rBe27dcc3423d5cb9781074f5eb0afc00496759e36

Cleanup: no need to use constraint space transform API here, we can directly call
BKE_armature_mat_pose_to_bone (and avoids the need to get an Object pointer!).
Note the former just calls the later internally, in this case.

===================================================================

M	source/blender/editors/animation/keyframing.c

===================================================================

diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 2fd30ed..2c1b3c6 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -57,7 +57,6 @@
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_armature.h"
-#include "BKE_constraint.h"
 #include "BKE_depsgraph.h"
 #include "BKE_fcurve.h"
 #include "BKE_main.h"
@@ -779,16 +778,9 @@ static float visualkey_get_value(PointerRNA *ptr, PropertyRNA *prop, int array_i
 		rotmode = ob->rotmode;
 	}
 	else if (ptr->type == &RNA_PoseBone) {
-		Object *ob = (Object *)ptr->id.data; /* we assume that this is always set, and is an object */
 		bPoseChannel *pchan = (bPoseChannel *)ptr->data;
 		
-		/* Although it is not strictly required for this particular space conversion, 
-		 * arg1 must not be null, as there is a null check for the other conversions to
-		 * be safe. Therefore, the active object is passed here, and in many cases, this
-		 * will be what owns the pose-channel that is getting this anyway.
-		 */
-		copy_m4_m4(tmat, pchan->pose_mat);
-		BKE_constraint_mat_convertspace(ob, pchan, tmat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL);
+		BKE_armature_mat_pose_to_bone(pchan, pchan->pose_mat, tmat);
 		rotmode = pchan->rotmode;
 		
 		/* Loc code is specific... */




More information about the Bf-blender-cvs mailing list