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>2008-09-29 08:00:42 +0400
committerJoshua Leung <aligorith@gmail.com>2008-09-29 08:00:42 +0400
commit32b733dafb18f5843ee4796aa65ec00423d00914 (patch)
tree46d40c29bb2a5046d0498c5a532522c270d6d35d /source/blender/blenkernel/intern/armature.c
parent0b622fc07f1a19c4fbc72782f6000814b66b2088 (diff)
Patch #17500: fixes: multiple IK's on bone + targetless IK
Submitted by: Teppo Kansala (teppoka) See patch report for details of fixes. https://projects.blender.org/tracker/index.php?func=detail&aid=17500&group_id=9&atid=127 Note: the patch submitter's test files were quite nice, and would be good to have in our regression suite.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 720ed0513ed..155d5a7d21c 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1573,21 +1573,16 @@ static void initialize_posetree(struct Object *ob, bPoseChannel *pchan_tip)
/* find IK constraint, and validate it */
for(con= pchan_tip->constraints.first; con; con= con->next) {
- if(con->type==CONSTRAINT_TYPE_KINEMATIC) break;
+ if(con->type==CONSTRAINT_TYPE_KINEMATIC) {
+ data=(bKinematicConstraint*)con->data;
+ if (data->flag & CONSTRAINT_IK_AUTO) break;
+ if (data->tar==NULL) continue;
+ if (data->tar->type==OB_ARMATURE && data->subtarget[0]==0) continue;
+ if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) break;
+ }
}
if(con==NULL) return;
- data=(bKinematicConstraint*)con->data;
-
- /* two types of targets */
- if(data->flag & CONSTRAINT_IK_AUTO);
- else {
- if(con->flag & CONSTRAINT_DISABLE) return; /* checked in editconstraint.c */
- if(con->enforce == 0.0f) return;
- if(data->tar==NULL) return;
- if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0) return;
- }
-
/* exclude tip from chain? */
if(!(data->flag & CONSTRAINT_IK_TIP))
pchan_tip= pchan_tip->parent;