Fix keymap loading multiple times

Blender defaults data-file was loading it's own key-map
with a capital 'B', the preset would load it again w/ a lowercase name.

Use lowercase key-map names.
This commit is contained in:
Campbell Barton
2018-11-19 13:07:57 +11:00
parent 3d92afca7e
commit 472b114761
2 changed files with 10 additions and 12 deletions

View File

@@ -5901,9 +5901,3 @@ def generate_keymaps(params=None):
# Command to lint:
#
# pylint release/scripts/presets/keyconfig/keymap_data/blender_default.py --disable=C0111,C0301,C0302,R0902,R0903,R0913
if __name__ == "__main__":
from bpy_extras.keyconfig_utils import keyconfig_import_from_data
keyconfig_import_from_data("blender", generate_keymaps())
keyconfig_import_from_data("blender_27", generate_keymaps(Params(legacy=True)))

View File

@@ -239,12 +239,16 @@ void WM_keyconfig_init(bContext *C)
wmWindowManager *wm = CTX_wm_manager(C);
/* create standard key configs */
if (!wm->defaultconf)
wm->defaultconf = WM_keyconfig_new(wm, "Blender", false);
if (!wm->addonconf)
wm->addonconf = WM_keyconfig_new(wm, "Blender Addon", false);
if (!wm->userconf)
wm->userconf = WM_keyconfig_new(wm, "Blender User", false);
if (wm->defaultconf == NULL) {
/* Keep lowercase to match the preset filename. */
wm->defaultconf = WM_keyconfig_new(wm, "blender", false);
}
if (wm->addonconf == NULL) {
wm->addonconf = WM_keyconfig_new(wm, "blender addon", false);
}
if (wm->userconf == NULL) {
wm->userconf = WM_keyconfig_new(wm, "blender user", false);
}
/* initialize only after python init is done, for keymaps that
* use python operators */