# Can I get the orientation matrix in real time?

I need to calculate the normal orientation matrix for the tool. There is a way to get a custom orientation matrix

bpy.context.scene.transform_orientation_slots[0].custom_orientation.matrix.to_4x4()


Is there a similar method for getting any orientation matrix ? (GLOBAL, LOCAL, NORMAL, GIMBAL, VIEW, CURSOR)

I will say in advance that I am not satisfied with creating a custom orientation, since I need to get a realtime matrix

• What exactly do you mean by "real time" in this context? – Robert Gützkow Feb 21 at 19:04
• @RobertGützkow I need a matrix for gizmo, so I can't execute statements from the draw_prepare function in gizmogroup. – Max Derksen Feb 21 at 19:10
• @RobertGützkow For example, I know how to get a normal matrix by executing a regular operator, using: bpy.context.window.scene.transform_orientation_slots[0].type = 'NORMAL' bpy.ops.transform.create_orientation(name=name, use=True, overwrite=True) user_matrix=bpy.context.scene.transform_orientation_slots[0].custom_orientation.matrix.to_4x4() But this is not suitable for gizmo – Max Derksen Feb 21 at 19:12