diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-02 14:21:24 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-02 14:21:24 +0300 |
commit | 26dff781b3c13ad21010d595d38baa5b8b6e06a5 (patch) | |
tree | bee08064424f2c1efce4fbb8f17ce8ce5b086a79 /source/blender/blenkernel/intern/armature_update.c | |
parent | c3eb22e2ab0f4f96d64d1de7969966efd5d45066 (diff) | |
parent | 37beac8eb823bd81b411426bfc8718639577b179 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/armature_update.c')
-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 1b8bf3feb10..de0dfe2530d 100644 --- a/source/blender/blenkernel/intern/armature_update.c +++ b/source/blender/blenkernel/intern/armature_update.c @@ -588,13 +588,15 @@ void BKE_pose_eval_init_ik(const struct EvaluationContext *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(eval_ctx, 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 @@ -607,9 +609,9 @@ void BKE_pose_eval_bone(const struct EvaluationContext *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) { @@ -674,8 +676,13 @@ void BKE_pose_iktree_evaluate(const struct EvaluationContext *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(eval_ctx, scene, ob, rootchan, ctime); } @@ -684,8 +691,13 @@ void BKE_pose_splineik_evaluate(const struct EvaluationContext *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(eval_ctx, scene, ob, rootchan, ctime); } |