This is what I mean about POSE and REST modes needing some sort of update event. I start off in REST mode, then switch to POSE mode and immediately print off the matrix:
>>> active.data.pose_position
'REST'
>>> active.data.pose_position='POSE'; bone.matrix
Matrix((-0.038484, 0.999073, -0.019294, 11.088013), (-0.014974, 0.018730, 0.999712, 40.200428), (0.999147, 0.038762, 0.014240, -1.268387), (0.000000, 0.000000, 0.000000, 1.000000))
>>> active.data.pose_position='POSE'; bone.matrix
Matrix((-0.011348, -0.999563, 0.027340, 8.099199), (0.106351, -0.028394, -0.993924, 45.399223), (0.994265, -0.008370, 0.106628, -3.855516), (0.000000, 0.000000, 0.000000, 1.000000))
>>> active.data.pose_position='REST'; bone.matrix
Matrix((-0.011348, -0.999563, 0.027340, 8.099199), (0.106351, -0.028394, -0.993924, 45.399223), (0.994265, -0.008370, 0.106628, -3.855516), (0.000000, 0.000000, 0.000000, 1.000000))
>>> active.data.pose_position='REST'; bone.matrix
Matrix((-0.038484, 0.999073, -0.019294, 11.088013), (-0.014974, 0.018730, 0.999712, 40.200428), (0.999147, 0.038762, 0.014240, -1.268387), (0.000000, 0.000000, 0.000000, 1.000000))
Notice the matrix only gets updated in the second pass. Whereas if I do separate commands:
>>> active.data.pose_position='POSE'
>>> bone.matrix
Matrix((-0.011348, -0.999563, 0.027340, 8.099199), (0.106351, -0.028394, -0.993924, 45.399223), (0.994265, -0.008370, 0.106628, -3.855516), (0.000000, 0.000000, 0.000000, 1.000000))
>>> active.data.pose_position='REST'
>>> bone.matrix
Matrix((-0.038484, 0.999073, -0.019294, 11.088013), (-0.014974, 0.018730, 0.999712, 40.200428), (0.999147, 0.038762, 0.014240, -1.268387), (0.000000, 0.000000, 0.000000, 1.000000))
presumably some sort of update happens in between the commands while on the console. Maybe this only occurs in linux?