From 3064da1200a97e4fba08be33dd271b09d65a2fde Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 8 Nov 2018 15:59:51 +1100 Subject: Keymap: move builtin keymaps from C to Python This should be purely an implementation change, for end users there should be no functional difference. The entire key configuration is in one file with ~5000 lines of code. Mostly avoiding code duplication and preserve comments and utility functions from the C code. It's a bit long but for searching and editing it's also convenient to have it all in one file. Notes: - Actual keymap is shared by blender / blender_legacy and stored in `keymap_data/blender_default.py` This only generates JSON-like data to be passed into `keyconfig_import_from_data`, allowing other presets to load and manipulate the default keymap. - Each preset defines 'keyconfig_data' which can be shared between presets. - Some of the utility functions for generating keymap items still need to be ported over to Python. - Some keymap items can be made into loops (marked as TODO). See: D3907 --- source/blender/editors/lattice/lattice_ops.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'source/blender/editors/lattice') diff --git a/source/blender/editors/lattice/lattice_ops.c b/source/blender/editors/lattice/lattice_ops.c index 6cf3c580698..76ccc2250ee 100644 --- a/source/blender/editors/lattice/lattice_ops.c +++ b/source/blender/editors/lattice/lattice_ops.c @@ -37,7 +37,6 @@ #include "ED_screen.h" #include "ED_select_utils.h" -#include "ED_keymap_templates.h" #include "ED_object.h" #include "ED_lattice.h" @@ -57,23 +56,6 @@ void ED_operatortypes_lattice(void) void ED_keymap_lattice(wmKeyConfig *keyconf) { - wmKeyMap *keymap; - - keymap = WM_keymap_ensure(keyconf, "Lattice", 0, 0); + wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Lattice", 0, 0); keymap->poll = ED_operator_editlattice; - - ED_keymap_template_select_all(keymap, "LATTICE_OT_select_all"); - - WM_keymap_add_item(keymap, "LATTICE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "LATTICE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0); - - WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); - - WM_keymap_add_item(keymap, "LATTICE_OT_flip", FKEY, KM_PRESS, KM_ALT, 0); - - /* menus */ - WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0); - - ED_keymap_proportional_cycle(keyconf, keymap); - ED_keymap_proportional_editmode(keyconf, keymap, false); } -- cgit v1.2.3