[Bf-blender-cvs] [be1e61b0935] master: Cleanup: tweak logic for skipping modules

Campbell Barton noreply at git.blender.org
Thu Jun 13 04:38:28 CEST 2019


Commit: be1e61b09352498e570c2852e7cc7ccb0d20394d
Author: Campbell Barton
Date:   Thu Jun 13 10:03:06 2019 +1000
Branches: master
https://developer.blender.org/rBbe1e61b09352498e570c2852e7cc7ccb0d20394d

Cleanup: tweak logic for skipping modules

Startup is the special case, so match against this instead of 'modules'.

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

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 d3e0ecc729d..c96b0b88c6b 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -254,12 +254,10 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
                 if _os.path.isdir(path):
                     _sys_path_ensure(path)
 
-                    # only add this to sys.modules, don't run
-                    if path_subdir == "modules":
-                        continue
-
-                    for mod in modules_from_path(path, loaded_modules):
-                        test_register(mod)
+                    # Only add to 'sys.modules' unless this is 'startup'.
+                    if path_subdir == "startup":
+                        for mod in modules_from_path(path, loaded_modules):
+                            test_register(mod)
 
     # load template (if set)
     if any(_bpy.utils.app_template_paths()):



More information about the Bf-blender-cvs mailing list