[Bf-python] Making IK flag writable in the Bone class

Jonas Petersen blenderjox at mindfloaters.de
Sat Oct 23 04:09:02 CEST 2004


Ok, good news! :)

I added a Bone_setIK() function which takes an int as parameter.
Question: what should happen if the bone has no parent? Warning / Error 
/ Nothing.
Now it throws a runtime error. But I thought it might be a bit too strict...

Bone_hasIK() has already functionality of Bone_getIK() so this is no 
problem. Maybe good would be renaming Bone_hasIK() to Bone_getIK() and 
have Bone_hasIK() call Bone_getIK() for campatibility?

I also modified the 'ik' member variable to add write access!

Now the IK flag can be modified in the following ways:

  bone.ik = True
  bone.setIK(True)

I tested it and observed the resulting matrices and other attributes 
(also of child and parent bones) compared to the IK switch in the UI 
panel and everythink looks fine (same results).

Btw. speaking of confusion and misleading... Perhaps it would be more 
clear and appropriate to call the functions getIKFlag() and setIKFlag() 
instead of getIK() / setIK(). What's your opinion?

Last question: if I post a patch to the list, do I paste it in the mail 
body or make an attachment?

Jonas



More information about the Bf-python mailing list