def FrameMatrix(f): t = Matrix.Translation(Vector((f.t.x, f.t.y, f.t.z))) # s = Matrix.Scale r = Euler((f.rx, f.ry, f.rz), 'XYZ').to_matrix().to_4x4() res = t*r return res