Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-13 10:57:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-13 10:57:03 +0400
commit0c815a42fd42ffb19321945617686ff82921b873 (patch)
tree16ec96760c86463d05556217055696b13f7097d0 /source/blender/editors/armature/poseobject.c
parentbd5a62cfcb7ddf4a6c111eede3d4a496902138ee (diff)
bugfix [#23528] ED_pose_channel_in_IK_chain() doesn't take length of IK chain into account
Diffstat (limited to 'source/blender/editors/armature/poseobject.c')
-rw-r--r--source/blender/editors/armature/poseobject.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 3bbbb271bda..b8c945f0d77 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -157,7 +157,7 @@ static short pose_has_protected_selected(Object *ob, short only_selected, short
}
/* only for real IK, not for auto-IK */
-int ED_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
+static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level)
{
bConstraint *con;
Bone *bone;
@@ -167,18 +167,25 @@ int ED_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
for(con= pchan->constraints.first; con; con= con->next) {
if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
bKinematicConstraint *data= con->data;
- if((data->flag & CONSTRAINT_IK_AUTO)==0)
- return 1;
+ if(data->rootbone == 0 || data->rootbone > level) {
+ if((data->flag & CONSTRAINT_IK_AUTO)==0)
+ return 1;
+ }
}
}
for(bone= pchan->bone->childbase.first; bone; bone= bone->next) {
pchan= get_pose_channel(ob->pose, bone->name);
- if(pchan && ED_pose_channel_in_IK_chain(ob, pchan))
+ if(pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
return 1;
}
return 0;
}
+int ED_pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan)
+{
+ return pose_channel_in_IK_chain(ob, pchan, 0);
+}
+
/* ********************************************** */
/* Motion Paths */