In bpy_extras.keyconfig_utils module, keyconfig_export function includes these lines:

for km, kc_x in export_keymaps:
    km = km.active()

km is a bpy.types.KeyMap object, and is replaced by the result of a call to its own active() method, which is of the same type.

What is the purpose of doing this? The API documentation just says:

Returns: Key Map, Active key map

and I was not able to find the class source (closest was this).

  • $\begingroup$ My first guess, the active keymap gets exported on each loop, the call to active makes it the active map and resets the km value to ensure that any change in pointer value during activation keeps km correct. $\endgroup$ – sambler Nov 5 '18 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.