0
$\begingroup$

enter image description here

Hello!

I'm trying to set the orientation of the 3D cursor to "Geometry" in the keymapping preferences in Blender but having some difficulty. If anyone can point me in the right direction, I would really appreciate it!

Thank you.

$\endgroup$

1 Answer 1

0
$\begingroup$

There are different ways to change the key map:

  1. You can change the user keymapping at runtime (although i'm not quite sure what the advantage would be over using the UI):

    bpy.context.window_manager.keyconfigs['Blender user'].keymaps['3D View'].keymap_items['view3d.cursor3d'].properties.orientation = 'GEOM'
    

    See docs for the operator properties: https://docs.blender.org/api/3.2/bpy.ops.view3d.html#bpy.ops.view3d.cursor3d

    You need to call bpy.ops.wm.save_userpref to make this persistent, otherwise the change is discarded when closing Blender.

  2. You can change the "factory default" by changing the properties in <Blender install>/<version>/scripts/presets/keyconfig/keymap_data/blender_default.py. I wouldn't recommend this unless you are actually planning to submit a patch.

    # 3D cursor
    if params.cursor_tweak_event:
        items.extend([
            ("view3d.cursor3d", params.cursor_set_event, {"properties": [("orientation": 'GEOM')]}),
            ("transform.translate", params.cursor_tweak_event,
             {"properties": [("release_confirm", True), ("cursor_transform", True)]}),
        ])
    else:
        items.extend([
            ("view3d.cursor3d", params.cursor_set_event, {"properties": [("orientation": 'GEOM')]}
        ])
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .