Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-04-16 13:31:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-16 13:31:58 +0400
commit7eb4eebe2263706d84776ec4a4ce45ce971e98a7 (patch)
treea94f1ecd02e3e13bce5eaf54a50ccb2a59a5bd64
parent182587fce100df0c9543e8be9493e9f539a3fbae (diff)
add the modules directory from the user scripts path (if it exists)
-rw-r--r--release/scripts/modules/bpy/utils.py19
1 files 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)