[Bf-blender-cvs] [04cdf8d0404] blender2.8: Keymap: skip loading the keymap preset in background mode

Campbell Barton noreply at git.blender.org
Fri Nov 9 01:44:27 CET 2018


Commit: 04cdf8d04040f080372c129e218004a56da210f2
Author: Campbell Barton
Date:   Fri Nov 9 11:43:45 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB04cdf8d04040f080372c129e218004a56da210f2

Keymap: skip loading the keymap preset in background mode

Caused a crash on exit and isn't needed.

===================================================================

M	release/scripts/modules/bpy/utils/__init__.py

===================================================================

diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py
index eb1b93002a9..b76050395da 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -146,6 +146,7 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
     """
     use_time = use_class_register_check = _bpy.app.debug_python
     use_user = not _is_factory_startup
+    is_background = _bpy.app.background
 
     if use_time:
         import time
@@ -261,17 +262,20 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
         _addon_utils.reset_all(reload_scripts=reload_scripts)
     del _initialize
 
-    # Load the default key configuration.
-    filepath = preset_find("blender", "keyconfig")
-    if filepath:
-        keyconfig_set(filepath)
+    if not is_background:
+        # Load the default key configuration.
+        filepath = preset_find("blender", "keyconfig")
+        if filepath:
+            keyconfig_set(filepath)
 
-    # run the active integration preset
-    filepath = preset_find(_user_preferences.inputs.active_keyconfig,
-                           "keyconfig")
+        # run the active integration preset
+        filepath = preset_find(
+            _user_preferences.inputs.active_keyconfig,
+            "keyconfig",
+        )
 
-    if filepath:
-        keyconfig_set(filepath)
+        if filepath:
+            keyconfig_set(filepath)
 
     if reload_scripts:
         import gc



More information about the Bf-blender-cvs mailing list