[Bf-blender-cvs] [fe82a09f89c] master: Fix T53980: IK influencing REST POSE with New Depsgraph

Sergey Sharybin noreply at git.blender.org
Fri Feb 2 10:37:32 CET 2018


Commit: fe82a09f89ce01810869fc4518f4a210ddd54ab9
Author: Sergey Sharybin
Date:   Fri Feb 2 10:37:06 2018 +0100
Branches: master
https://developer.blender.org/rBfe82a09f89ce01810869fc4518f4a210ddd54ab9

Fix T53980: IK influencing REST POSE with New Depsgraph

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

M	source/blender/blenkernel/intern/armature_update.c

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

diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index aac9cfdf792..cc1bd9716b1 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -587,13 +587,15 @@ void BKE_pose_eval_init_ik(EvaluationContext *UNUSED(eval_ctx),
                            Object *ob,
                            bPose *UNUSED(pose))
 {
-	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
-
 	DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
-
+	BLI_assert(ob->type == OB_ARMATURE);
+	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+	bArmature *arm = (bArmature *)ob->data;
+	if (arm->flag & ARM_RESTPOS) {
+		return;
+	}
 	/* 2a. construct the IK tree (standard IK) */
 	BIK_initialize_tree(scene, ob, ctime);
-
 	/* 2b. construct the Spline IK trees
 	 *  - this is not integrated as an IK plugin, since it should be able
 	 *	  to function in conjunction with standard IK
@@ -606,9 +608,9 @@ void BKE_pose_eval_bone(EvaluationContext *UNUSED(eval_ctx),
                         Object *ob,
                         bPoseChannel *pchan)
 {
-	bArmature *arm = (bArmature *)ob->data;
 	DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
 	BLI_assert(ob->type == OB_ARMATURE);
+	bArmature *arm = (bArmature *)ob->data;
 	if (arm->edbo || (arm->flag & ARM_RESTPOS)) {
 		Bone *bone = pchan->bone;
 		if (bone) {
@@ -673,8 +675,13 @@ void BKE_pose_iktree_evaluate(EvaluationContext *UNUSED(eval_ctx),
                               Object *ob,
                               bPoseChannel *rootchan)
 {
-	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
+	BLI_assert(ob->type == OB_ARMATURE);
+	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+	bArmature *arm = (bArmature *)ob->data;
+	if (arm->flag & ARM_RESTPOS) {
+		return;
+	}
 	BIK_execute_tree(scene, ob, rootchan, ctime);
 }
 
@@ -683,8 +690,13 @@ void BKE_pose_splineik_evaluate(EvaluationContext *UNUSED(eval_ctx),
                                 Object *ob,
                                 bPoseChannel *rootchan)
 {
-	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
+	BLI_assert(ob->type == OB_ARMATURE);
+	const float ctime = BKE_scene_frame_get(scene); /* not accurate... */
+	bArmature *arm = (bArmature *)ob->data;
+	if (arm->flag & ARM_RESTPOS) {
+		return;
+	}
 	BKE_splineik_execute_tree(scene, ob, rootchan, ctime);
 }



More information about the Bf-blender-cvs mailing list