diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-23 08:20:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-23 08:38:29 +0300 |
commit | 7733bd5efc8e90f85385e5a93066158a17b14a93 (patch) | |
tree | 175139f1a6ec9a3e4e89bb8ed8e09c8d2756a3b5 /release/scripts/modules/bpy | |
parent | 783b4cd1ca22de57c98ebcfaeec7a20936a9a621 (diff) |
PyAPI: avoid scanning all addons on startup
Gives small speedup
Diffstat (limited to 'release/scripts/modules/bpy')
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index dd771aff044..bf882db74d9 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -244,7 +244,14 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): test_register(mod) # deal with addons separately - _addon_utils.reset_all(reload_scripts) + _initialize = getattr(_addon_utils, "_initialize", None) + if _initialize is not None: + # first time, use fast-path + _initialize() + del _addon_utils._initialize + else: + _addon_utils.reset_all(reload_scripts) + del _initialize # run the active integration preset filepath = preset_find(_user_preferences.inputs.active_keyconfig, |