[Bf-committers] Custom keymap

Isaac Weaver wisaac407 at gmail.com
Thu Apr 13 23:10:13 CEST 2017


Hi all,

I'm working on a keymap for Blender and am looking for a way to only
include the actual changes I want without having to include the rest of the
default keymap for the affected regions. I wrote a context manager that
will merge the default Blender keymap with the new one.

Here's an example: https://gitlab.com/snippets/1657690

It works perfectly when I first import the keymap, but when I save it as
default and reopen Blender I get the fallowing error:

Traceback (most recent call last):
>   File
> "/home/isaac/blender-git/cmake_build/bin/2.78/scripts/modules/bpy/utils/__init__.py",
> line 519, in keyconfig_set
>     {"__file__": filepath})
>   File
> "/home/isaac/.config/blender/2.78/scripts/presets/keyconfig/keymap.py",
> line 42, in <module>
>     kmi = km.keymap_items.new('console.autocomplete', 'TAB', 'PRESS')
>   File
> "/home/isaac/.config/blender/2.78/scripts/presets/keyconfig/keymap.py",
> line 14, in __exit__
>     dkm = wm.keyconfigs.default.keymaps[self.km.name]
> KeyError: 'bpy_prop_collection[key]: key "Console" not found'


It seems that Blender is loading whatever the active keymap is before it's
loading the default keymap.  If that is the case is there any workaround?

Thanks,

~ Isaac


More information about the Bf-committers mailing list