diff options
Diffstat (limited to 'release/scripts/modules/bl_keymap_utils/io.py')
-rw-r--r-- | release/scripts/modules/bl_keymap_utils/io.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py index 091cdbc2642..645a145f994 100644 --- a/release/scripts/modules/bl_keymap_utils/io.py +++ b/release/scripts/modules/bl_keymap_utils/io.py @@ -222,12 +222,21 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False): fw("]\n") fw("\n\n") fw("if __name__ == \"__main__\":\n") + + # We could remove this in the future, as loading new key-maps in older Blender versions + # makes less and less sense as Blender changes. + fw(" # Only add keywords that are supported.\n") + fw(" from bpy.app import version as blender_version\n") + fw(" keywords = {}\n") + fw(" if blender_version >= (2, 92, 0):\n") + fw(" keywords[\"keyconfig_version\"] = keyconfig_version\n") + fw(" import os\n") fw(" from bl_keymap_utils.io import keyconfig_import_from_data\n") fw(" keyconfig_import_from_data(\n") fw(" os.path.splitext(os.path.basename(__file__))[0],\n") fw(" keyconfig_data,\n") - fw(" keyconfig_version=keyconfig_version,\n") + fw(" **keywords,\n") fw(" )\n") |