Fix 'Load Factory Settings' loosing the keymap

Caused by recent move to Python based keymaps.
This commit is contained in:
Campbell Barton 2018-11-10 11:04:32 +11:00
parent 0121258770
commit dc21ef7b86
Notes: blender-bot 2023-02-14 05:53:38 +01:00
Referenced by issue #57770, Vertices visible in XRay/Edit Mode can't be reselected after initial select and transform operation
Referenced by issue #57759, The eevee view model failed to load the texture, causing the model to be purple
1 changed files with 7 additions and 0 deletions

View File

@ -511,6 +511,13 @@ static void wm_file_read_post(bContext *C, const bool is_startup_file, const boo
}
BPY_python_reset(C);
addons_loaded = true;
if (!G.background) {
/* Load the keymap from Python, otherwise we get an empty keymap. */
BPY_execute_string(
C, (const char *[]){"bpy", NULL},
"bpy.utils.keyconfig_set(bpy.utils.preset_find('blender', 'keyconfig'))");
}
}
}
else {