[Bf-python] Making IK flag writable in the Bone class
blenderjox at mindfloaters.de
Fri Oct 22 19:09:43 CEST 2004
Gilbert, Joseph schrieb:
>There is more to it than that. The reason that setIK was not implemented
>was that once the flag is set the matrix of each bone must be
>recalculated so that the head becomes attached to the tail of the
>preceeding bone. You will be able to set the flag but it's basically
>meaningless without the recalculation of the parent/child bone matrices.
Yea you're right. I investigated the issue. But as far as I can tell no
matrix has to be recalculated. Only the head position of the affected
bone has to get adjusted to the position of the parents tail. This is
done easily by just setting its position to (0,0,0) because its relative
to the parents tail anyway.
I python it could be done like this:
Btw. you can mess up the head of an IK'ed bone the same way:
This is not taken care of neither. Though it will correct itself
automatically as soon the joint will be moved.
But of course this is no excuse. So I modified the function further that
...will not set IK if affected bone has no parent.
...adjust head of affected bone.
I implemented and tested it positively.
What do you think?
>From: bf-python-bounces at projects.blender.org
>[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Jonas
>Sent: Friday, October 22, 2004 8:10 AM
>To: bf-python at projects.blender.org
>Subject: [Bf-python] Making IK flag writable in the Bone class
>I hope this ist the right place to post this...
>The IK flag in the Bone python class is read only. The only way to
>modify it is the corresponding button in the buttons panel. It's not
>possible via python.
>I modified python/api2_2x/Bone.c so the flag can be modified via
>For now I did it by adding an optional bool parameter to the hasIK()
>function that sets/unsets the flag.
>An alternative or additional way would be to make the IK class member
>What do you think?
>I could supply a patch if desired.
More information about the Bf-python