[Bf-committers] Python bone.roll bugfix and dof bindings

Alberto Torres kungfoobar at gmail.com
Sun Jun 18 06:41:46 CEST 2006


Hello,
I fixed a bug that made me crazy while I was making a python script.

Select an armature and get the roll value in editmode
arm=Blender.GetSelected()[0].getData()
arm.makeEditable()
print arm.bones['Bone'].roll
(always getting something like -4.12342341324e-44)

Without makeEditable() I was getting the correct value, but I later
discovered that the bindings are different in editmode. The binding
for roll was buggy. I've attached a patch.

I also needed to access all DoF (degrees of freedom, not depth of
field) values. There are already limitMin and limitMax.
I added stiffness, ikstretch, lock x/y/z and limit x/y/z. I
implemented the last two as arrays of booleans (dofLock and dofLimit),
also accepting arrays of integers (i.e. [True,False,True] or [1,0,1]).

I knew nothing about python one week ago, but I made my first script
(dealing with armatures and constraints), then I made my first blender
patch and ended up hacking blender code to suit my needs. Am I
becoming addicted to this?

Although cvs was feature frozen last Tuesday, I think my code is good
enough to be included in the next Blender release.

Best regards
--
Alberto Torres Ruiz (a.k.a. DiThi)
e-mail: kungfoobar at gmail.com
Jabber ID: dithi at jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rollfix.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/bf-committers/attachments/20060618/c2979df5/rollfix-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dofbindings.patch
Type: text/x-patch
Size: 10789 bytes
Desc: not available
Url : http://projects.blender.org/pipermail/bf-committers/attachments/20060618/c2979df5/dofbindings-0001.bin


More information about the Bf-committers mailing list