Macros and Keybindings

Coming from Modo I’m just wondering: Does Blender have a macro recorder or is there a posibility for me to bind Python macros to hotkeys easily?

Let’s say I want to set up a macro to select and convert all the NGons into triangles and possibly quadrangulate them immediately.

The Python code is easy enough to figure out from the command history:

bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.mesh.select_face_by_sides(number=4, type='GREATER')
bpy.ops.mesh.quads_convert_to_tris(ngon_method='BEAUTY')
bpy.ops.mesh.tris_convert_to_quads(shape_threshold=3.04909)

When I paste that into the console it works good enough as well. But is there an easy way to save this as a python script or macro and then create a tool from it or bind it to a keyboard shortcut?

Put it in the Blender text editor where you can save and run it. Blender doesn’t have a macro recorder but there are addons for it.

Ah okay - running it from the texteditor works. Thanks :slight_smile:
But can I save that and make it into a shortcut somehow?
Or do I need a macro plugin for that?