reset bone matrices?

I want to process all of the bones in an armature by setting a matrix to each. It seems like setting a matrix doesn’t modify the bone’s lenght and it seems the resulting (armaturespace) matrix that ends up for the bone is not the same as the matrix you set on the bone via bone.matrix = matrix (yes, I’m using Blender 2.4 API).

What am I doing wrong? Does the matrix maybe get added or multiplied to the existing matrix? Is perhaps the bone tip and base position not modified by applying matrix and it gets added to the resulting matrix in the end? Can I just delete the bone and make a new one with the same name as it and assign the matrix to him instead? (How do you delete a bone?).

bringing up my post…