[2.4] bone stuff

That line gives

 sequence index must be integer, not 'str'

the problem is the [“ARMATURESPACE”], sounds like you handle it as a dictionary but its really a list, or something like that.

I have tryed the code now and it is doing what it should.
Here it comes again with all modifications and now it should behave in the way you need. Else I completly misunderstood.


for bone in skeleton.bones.keys():
    if len(skeleton.bones[bone].children) == 1:
        child = arm.bones[bone].children[0]
        arm.makeEditable()
        childbone = arm.bones[child.name]
        editbone = arm.bones[bone]
        editbone.tail = child.head['ARMATURESPACE']
        childbone.options = [Blender.Armature.CONNECTED]
        skeleton.update()

Here is a testfile for you.
Watch the armature in Editmode before you apply the script and after you did it.
And have a closer look to the feets.

Test.blend (310 KB)

now it seems to work, but…

You have “arm” and “skeleton” vars in your script, did you just forgot to fix that and both are the same Armature object, or is “arm” of type Object?
99% of bones now seem right, but there are still a few which don’t connect. Can you think of a case which might cause this?

I’m sorry about this.
Its a mixture out of your and my own script that i have used for testing. Replace arm with skeleton if you havent already. Do you have an armature that causes this problems for testing?