mathutils.Matrix's position returns an empty vector instead of the actual position

In 4x4 matrices, the values of the last row are usually the position, however in blender, when scripting returns 0, even though when i display the matrix on the console, the values are shown properly (Even applying the matrix to the object)

Here's what i do in the code

tfm = node.properties.transform
print(tfm)
dec = tfm.decompose()
print(dec)


decompose() returns 3 values, which are the position, rotation, and scale:

<Matrix 4x4 ( 0.9962,  0.0000, -0.0872, 0.0000)
(-0.0000,  1.0000, -0.0000, 0.0000)
( 0.0872,  0.0000,  0.9962, 0.0000)
( 9.6625, 12.2470, 55.6297, 1.0000)>

(Vector((0.0, 0.0, 0.0)),
Quaternion((0.9990482330322266, 7.4434889363317325e-09, -0.04361938312649727, -3.249897295720672e-10)),
Vector((1.0, 1.0, 1.0)))


These are the results after decomposing, which is what is applied to the object in blender when i do:

obj.matrix_world = tfm


However, even though the object rotates, it does not move.

A workaroud for this is applying the position is this way:

obj.location = (tfm[3][0],tfm[3][1],tfm[3][2])


However i should not be doing this and i would like to straight up apply the matrix and get all the values properly. Am i using the wrong method? Or maybe library? I think i'm not getting the proper values, even scale and rotation wise.

• Looks like you have a transposed matrix if you are expecting row 3 (instead of column 3) to be the location. – batFINGER Nov 1 '16 at 7:18