In version 2.77a; the docs show that the
edit_bone.matrix is no longer read only, but a note warns "does not include bone length". Luckily,
edit_bones also have a property
length you can set:
The distance from head to tail, when set the head is moved to fit the length.
With that in mind, I tried assigning the matrix, then setting the bone's length:
bone.matrix = bone_imatrix[0:16] bone.length = 0.1
But when I check the transform of the bone, the
bone.length = 0.1 doesn't reflect what the docs said: "head is moved to fit length". (Hopefully they'll allow moving the tail to fit instead of the head.)
Head and tail are still the same, making it invalid, and disappears as soon as I change the mode back to OBJECT.
I tried using
bone.transform(bone_imatrix, True, True) but it does nothing (Odd):
print( bone_imatrix ) >> <Matrix 4x4 ( 0.0000, -0.0000, -1.0000, -0.0000) (-0.0000, 1.0000, -0.0000, 0.0000) ( 1.0000, -0.0000, 0.0000, -0.0000) (-0.0000, 1.9815, -0.5483, 1.0000)>
Here are the values I was expecting:
Question: Why is the matrix getting set but not the length? Is there a better way of assigning the bone matrix?