Skip to main content
3 of 4
added 236 characters in body
CodeManX
  • 29.7k
  • 3
  • 92
  • 131

Are you after one of these, e.g. rotate?

>>> C.window_manager.keyconfigs.user.keymaps['Transform Modal Map'].keymap_items[5].propvalue
'ROTATE'

I'm pretty sure there's only one modal map for all transform operators (and not changable with python).

import bpy
wm = bpy.context.window_manager
keymap = [k for k in wm.keyconfigs.user.keymaps['Transform Modal Map'].keymap_items if k.type == 'G'] #k.propvalue=="TRANSLATE"]
modal_translate = keymap[0] if len(keymap) > 0 else None
print("\n", modal_translate)
for attr in dir(modal_translate):
    if not attr.startswith("_"):
        val = getattr(modal_translate, attr)
        if type(val) in {int, float, str, bool}:
            print("\t", attr, "=", val)

But note that you can't provide an operator name in modal maps. Only the predefined modal operations can be set (propvalue).

CodeManX
  • 29.7k
  • 3
  • 92
  • 131