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:
authorJoshua Leung <aligorith@gmail.com>2007-11-08 11:27:21 +0300
committerJoshua Leung <aligorith@gmail.com>2007-11-08 11:27:21 +0300
commit45f72036a55b4a1411b43080749cab8dc0ed4145 (patch)
tree1cbafdcb468afef9785d74365f470452133664f7
parent3f6d993dce9cc94059e70a258f9d0822e8ab0c30 (diff)
Patch #7722: no 'Auto IK' for solitary (unconnected) bone
'Auto IK' is a great feature, however when solitary unconnected bone (without connected child bones) is grabbed it can't be moved because of IK. This can be really annoying. Preventing 'Auto IK' for solitary bones would improve user-experience by making mixing of FK and IK more convenient while using 'Auto IK'. Patch by Teppo Kansala (teppoka).
-rw-r--r--source/blender/src/transform_conversions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 820d79eb809..3dc757f11ca 100644
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -765,6 +765,7 @@ static void pose_grab_with_ik(Object *ob)
{
bArmature *arm;
bPoseChannel *pchan, *pchansel= NULL;
+ Bone *bonec;
if(ob==NULL || ob->pose==NULL || (ob->flag & OB_POSEMODE)==0)
return;
@@ -782,6 +783,14 @@ static void pose_grab_with_ik(Object *ob)
}
}
if(pchan || pchansel==NULL) return;
+
+ /* rule: no IK for solitary (unconnected) bone */
+ for(bonec=pchansel->bone->childbase.first; bonec; bonec=bonec->next) {
+ if(bonec->flag & BONE_CONNECTED) {
+ break;
+ }
+ }
+ if ((pchansel->bone->flag & BONE_CONNECTED)==0 && (bonec == NULL)) return;
/* rule: if selected Bone is not a root bone, it gets a temporal IK */
if(pchansel->parent) {
@@ -3240,3 +3249,4 @@ void createTransData(TransInfo *t)
G.scene->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */
}
+