def get_view_rotational_matrix(reverse=False): qt = mathutils.Quaternion(bpy.context.scene.ne_view_orientation) if reverse: qt.conjugate() return qt.to_matrix()