diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 11:36:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 11:36:39 +0300 |
commit | e217fb439ffab5dbd979ff261f6a2d816f7d7c83 (patch) | |
tree | 21ca99c453a58b1bb8a58b56c8baf63e7573c5c3 /source/blender/blenkernel/intern/armature_update.c | |
parent | d54a058f35d3fa9cf7d78042e7119532fc93c33b (diff) | |
parent | 909efe6be5778f01cc2b870d54f5afafb5ff66c6 (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 | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c index 54f1a353486..5b51cd9502f 100644 --- a/source/blender/blenkernel/intern/armature_update.c +++ b/source/blender/blenkernel/intern/armature_update.c @@ -558,6 +558,15 @@ void BKE_splineik_execute_tree( /* *************** Depsgraph evaluation callbacks ************ */ +BLI_INLINE bPoseChannel *pose_pchan_get_indexed(Object *ob, int pchan_index) +{ + bPose *pose = ob->pose; + BLI_assert(pose != NULL); + BLI_assert(pchan_index >= 0); + BLI_assert(pchan_index < MEM_allocN_len(pose->chan_array) / sizeof(bPoseChannel *)); + return pose->chan_array[pchan_index]; +} + void BKE_pose_eval_init(const struct EvaluationContext *UNUSED(eval_ctx), Scene *UNUSED(scene), Object *ob) @@ -613,8 +622,7 @@ void BKE_pose_eval_bone(const struct EvaluationContext *eval_ctx, Object *ob, int pchan_index) { - BLI_assert(ob->pose != NULL); - bPoseChannel *pchan = ob->pose->chan_array[pchan_index]; + bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index); DEG_debug_print_eval_subdata( __func__, ob->id.name, ob, "pchan", pchan->name, pchan); BLI_assert(ob->type == OB_ARMATURE); @@ -651,8 +659,7 @@ void BKE_pose_constraints_evaluate(const struct EvaluationContext *eval_ctx, Object *ob, int pchan_index) { - BLI_assert(ob->pose != NULL); - bPoseChannel *pchan = ob->pose->chan_array[pchan_index]; + bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index); DEG_debug_print_eval_subdata( __func__, ob->id.name, ob, "pchan", pchan->name, pchan); bArmature *arm = (bArmature *)ob->data; @@ -674,8 +681,7 @@ void BKE_pose_bone_done(const struct EvaluationContext *UNUSED(eval_ctx), struct Object *ob, int pchan_index) { - BLI_assert(ob->pose != NULL); - bPoseChannel *pchan = ob->pose->chan_array[pchan_index]; + bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index); float imat[4][4]; DEG_debug_print_eval(__func__, pchan->name, pchan); if (pchan->bone) { @@ -689,8 +695,7 @@ void BKE_pose_iktree_evaluate(const struct EvaluationContext *eval_ctx, Object *ob, int rootchan_index) { - BLI_assert(ob->pose != NULL); - bPoseChannel *rootchan = ob->pose->chan_array[rootchan_index]; + bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index); DEG_debug_print_eval_subdata( __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan); BLI_assert(ob->type == OB_ARMATURE); @@ -708,8 +713,7 @@ void BKE_pose_splineik_evaluate(const struct EvaluationContext *eval_ctx, int rootchan_index) { - BLI_assert(ob->pose != NULL); - bPoseChannel *rootchan = ob->pose->chan_array[rootchan_index]; + bPoseChannel *rootchan = pose_pchan_get_indexed(ob, rootchan_index); DEG_debug_print_eval_subdata( __func__, ob->id.name, ob, "rootchan", rootchan->name, rootchan); BLI_assert(ob->type == OB_ARMATURE); |