diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-02 12:37:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-02 12:37:06 +0300 |
commit | fe82a09f89ce01810869fc4518f4a210ddd54ab9 (patch) | |
tree | d927ffc4392fc8995b58fe6cd7167da504deffb4 /source/blender | |
parent | 88e69806b977a6ec97c807f5e97db3bf68cff759 (diff) |
Fix T53980: IK influencing REST POSE with New Depsgraph
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/armature_update.c | 26 |
1 files changed, 19 insertions, 7 deletions
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); } |