[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28227] trunk/blender/release/scripts/ modules/bpy/utils.py: add the modules directory from the user scripts path (if it exists)
Campbell Barton
ideasman42 at gmail.com
Fri Apr 16 11:32:00 CEST 2010
Revision: 28227
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28227
Author: campbellbarton
Date: 2010-04-16 11:31:58 +0200 (Fri, 16 Apr 2010)
Log Message:
-----------
add the modules directory from the user scripts path (if it exists)
Modified Paths:
--------------
trunk/blender/release/scripts/modules/bpy/utils.py
Modified: trunk/blender/release/scripts/modules/bpy/utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/utils.py 2010-04-16 08:35:50 UTC (rev 28226)
+++ trunk/blender/release/scripts/modules/bpy/utils.py 2010-04-16 09:31:58 UTC (rev 28227)
@@ -168,21 +168,20 @@
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)
More information about the Bf-blender-cvs
mailing list