# Creating armatures in python

I'm relly new to Blender, so I must be missing something basic here. What I'm trying to do is import a model and its skeleton previously exported from 3DSMax in a custom format (json serialized).

I've got pretty far, but I'm getting some weird effects on the vertices weights (I guess...)

As you can see below, the models and its skeleton is built correctly. The bones are correctly set in the skeleton hierarchy. Also, the vertex groups and its modifiers looks right.

But when I rotate the upper arm some non weighted vertices move too.

The movement of the head and some other parts are perfect, however

Thanks

• Here is the code used to build the skeleton, if it is of any help: pastebin.com/eu2dpsFm – Iguatemi Mar 10 '17 at 0:02
• I have not read the code, but it seems that the bones are inverted: parent may be children and children parents – lemon Mar 10 '17 at 7:00
• The code does not indicate how the bone["parentIndex"] are created previously. But probably the problem is there. – lemon Mar 10 '17 at 7:28
• bone['parentIndex'] comes from max bone system, so it should be right, at least in the max context. When I import the model in max it works perfectly, so my guess is that there is a 'gotcha' or something that I'm missing. I'll check the hierarchy again, thanks for helping. – Iguatemi Mar 10 '17 at 13:17
• After re reading it: line 36 is incorrect... new_bone.head = parent.tail instead. But the definition itself could be different between blender and max (I don't know it, but for instance collada bones are defined differently from blender's bones). – lemon Mar 10 '17 at 13:22

new_bone.parent = parent