light-painter icon indicating copy to clipboard operation
light-painter copied to clipboard

Customizable keyboard shortcuts for modal tools

Open semagnum opened this issue 1 year ago • 1 comments

Due to a reverted commit in Blender's code, add-ons cannot define their own keymaps for modal operators (granted, it seems like it didn't fully work beforehand anyway). For Light Painter, the controls are all in keymap.py for those who need to edit them (and feel free to create PRs if you feel it would benefit others!). But to be more accessible for users, options are limited:

  • manually make properties for each possible tool command, including the key itself and whether each modifier key needs to be held down to use it (ie Alt, Shift, and Ctrl keys). The upside is that this is direct, and all possible key options can be generated from bpy.types.Event.bl_rna.properties["type"].enum_items. The downside is this won't be accessible in the keymap preferences, but in the Light Painter add-on preferences.
  • make "dummy" operator keymaps that don't actually work, but just used to match input to Light Painter. While it's located in keymaps, it's still not ideal.

It might be worth checking with Blender team to see if this feature is planned or someone is already working on it. If so, then it's a matter of setting up the modal keymap once the feature is merged.

semagnum avatar Dec 11 '23 22:12 semagnum