fix for bug where user scripts path set by an environment variable would write preset...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 29 Jun 2012 08:33:13 +0000 (08:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 29 Jun 2012 08:33:13 +0000 (08:33 +0000)
release/scripts/modules/bpy/utils.py

index da12975e4a6f9794884cf1cddeeebeac8188a0b3..43e4bea4bb34f34a4ccbb813595a18d2c38f77ea 100644 (file)
@@ -253,8 +253,8 @@ _scripts = (_os.path.normpath(_scripts), )
 
 
 def user_script_path():
-    prefs = _bpy.context.user_preferences
-    path = prefs.filepaths.script_directory
+    # returns the env var and falls back to userprefs
+    path = _user_resource('SCRIPTS')
 
     if path:
         path = _os.path.normpath(path)
@@ -281,7 +281,7 @@ def script_paths(subdir=None, user_pref=True, check_all=False):
     prefs = _bpy.context.user_preferences
 
     # add user scripts dir
-    user_script = prefs.filepaths.script_directory if user_pref else None
+    user_script = user_script_path()
 
     if check_all:
         # all possible paths