diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 02:56:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-20 03:06:01 +0300 |
commit | f8c16b0175799333f0ddb19478b1e7b834fcf00a (patch) | |
tree | 94cc3330a3ae01f67ba60fc720554ec84664497d /release/scripts/presets/keyconfig/blender.py | |
parent | d870e7d93023bc2120ddca5717eb8f1af40e6a57 (diff) |
Cleanup: move bpy_extras.keyconfig_utils to own module
bpy_extras were meant to be useful high-level helper functions for
script authors to perform common operations,
to avoid writing to verbose API's.
bpy_extras.keymap_utils contains some specialized API calls
mainly intended for Blender's own internal use.
Move keymap import export to internal API.
Diffstat (limited to 'release/scripts/presets/keyconfig/blender.py')
-rw-r--r-- | release/scripts/presets/keyconfig/blender.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/release/scripts/presets/keyconfig/blender.py b/release/scripts/presets/keyconfig/blender.py index 25246bf24d2..c750800ae4f 100644 --- a/release/scripts/presets/keyconfig/blender.py +++ b/release/scripts/presets/keyconfig/blender.py @@ -5,7 +5,8 @@ from bpy.props import ( EnumProperty, ) -idname = os.path.splitext(os.path.basename(__file__))[0] +dirname, filename = os.path.split(__file__) +idname = os.path.splitext(filename)[0] def update_fn(_self, _context): load() @@ -67,14 +68,12 @@ class Prefs(bpy.types.KeyConfigPreferences): layout.prop(self, "use_select_all_toggle") -from bpy_extras.keyconfig_utils import ( - keyconfig_init_from_data, - keyconfig_module_from_preset, -) +blender_default = bpy.utils.execfile(os.path.join(dirname, "keymap_data", "blender_default.py")) -blender_default = keyconfig_module_from_preset(os.path.join("keymap_data", "blender_default"), __file__) def load(): + from bl_keymap_utils.io import keyconfig_init_from_data + kc = bpy.context.window_manager.keyconfigs.new(idname) kc_prefs = kc.preferences |