diff options
author | Joshua Leung <aligorith@gmail.com> | 2013-09-13 07:03:46 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2013-09-13 07:03:46 +0400 |
commit | cca746c8e65503f4a98b1ccaf1110acb793b2b9b (patch) | |
tree | 3f4d8419375463951b902782d64cfc724d58ca9b /source/blender/editors | |
parent | 42524915b5dfee539dea4e7033fb19db883e33c0 (diff) |
Moved and renamed ED_pose_channel_in_IK_chain() ->
BKE_pose_channel_in_IK_chain()
This was needed for depsgraph work, and it's cleaner for RNA to have fewer
dependencies on editors
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 30 | ||||
-rw-r--r-- | source/blender/editors/include/ED_armature.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 2 |
3 files changed, 1 insertions, 32 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index e84008c3d15..31ff1e161e8 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -148,36 +148,6 @@ static short pose_has_protected_selected(Object *ob, short warn) } #endif -/* only for real IK, not for auto-IK */ -static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level) -{ - bConstraint *con; - Bone *bone; - - /* No need to check if constraint is active (has influence), - * since all constraints with CONSTRAINT_IK_AUTO are active */ - for (con = pchan->constraints.first; con; con = con->next) { - if (con->type == CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data = con->data; - 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 = BKE_pose_channel_find_name(ob->pose, bone->name); - 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 */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 454ccbcb9e6..225d8a0e5a3 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -167,7 +167,6 @@ void ED_armature_ebone_selectflag_disable(EditBone *ebone, int flag); /* poseobject.c */ void ED_armature_exit_posemode(struct bContext *C, struct Base *base); void ED_armature_enter_posemode(struct bContext *C, struct Base *base); -int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan); void ED_pose_deselectall(struct Object *ob, int test); void ED_pose_recalculate_paths(struct Scene *scene, struct Object *ob); struct Object *ED_pose_object_from_context(struct bContext *C); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 6961ada462d..2634dd3ec08 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1538,7 +1538,7 @@ static void draw_pose_dofs(Object *ob) if (bone->flag & BONE_SELECTED) { if (bone->layer & arm->layer) { if (pchan->ikflag & (BONE_IK_XLIMIT | BONE_IK_ZLIMIT)) { - if (ED_pose_channel_in_IK_chain(ob, pchan)) { + if (BKE_pose_channel_in_IK_chain(ob, pchan)) { float corner[4][3], posetrans[3], mat[4][4]; float phi = 0.0f, theta = 0.0f, scale; int a, i; |