From 7eb4eebe2263706d84776ec4a4ce45ce971e98a7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 16 Apr 2010 09:31:58 +0000 Subject: add the modules directory from the user scripts path (if it exists) --- release/scripts/modules/bpy/utils.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index 5b0599fe25f..1adb02f1358 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -168,21 +168,20 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): traceback.print_exc() _loaded[:] = [] - for base_path in script_paths(user=False): - for path_subdir in ("ui", "op", "io", "cfg", "keyingsets"): + user_path = user_script_path() + + for base_path in script_paths(): + for path_subdir in ("", "ui", "op", "io", "cfg", "keyingsets", "modules"): path = _os.path.join(base_path, path_subdir) if _os.path.isdir(path): sys_path_ensure(path) - for mod in modules_from_path(path, loaded_modules): - test_register(mod) + # only add this to sys.modules, dont run + if path_subdir == "modules": + continue - user_path = user_script_path() - if user_path: - for path_subdir in ("", "ui", "op", "io", "cfg", "keyingsets"): - path = _os.path.join(user_path, path_subdir) - if _os.path.isdir(path): - sys_path_ensure(path) + if user_path != base_path and path_subdir == "": + continue # avoid loading 2.4x scripts for mod in modules_from_path(path, loaded_modules): test_register(mod) -- cgit v1.2.3