[Bf-blender-cvs] [ec377e8] compositor-2016: Fix script_paths(check_all=True) missing script paths
Campbell Barton
noreply at git.blender.org
Wed Jun 8 21:46:52 CEST 2016
Commit: ec377e8a3e50ebd8e54d3dfa4b44f6149da6bf68
Author: Campbell Barton
Date: Sat May 14 03:25:06 2016 +1000
Branches: compositor-2016
https://developer.blender.org/rBec377e8a3e50ebd8e54d3dfa4b44f6149da6bf68
Fix script_paths(check_all=True) missing script paths
BLENDER_SYSTEM_SCRIPTS wasn't included in bpy.utils.script_paths()
===================================================================
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 986d8b9..5e2769c 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -305,15 +305,21 @@ def script_paths(subdir=None, user_pref=True, check_all=False):
"""
scripts = list(_scripts)
- if check_all:
- # all possible paths
- base_paths = tuple(_os.path.join(resource_path(res), "scripts")
- for res in ('LOCAL', 'USER', 'SYSTEM'))
- else:
- # only paths blender uses
- base_paths = _bpy_script_paths()
+ # Only paths Blender uses.
+ #
+ # Needed this is needed even when 'check_all' is enabled,
+ # so the 'BLENDER_SYSTEM_SCRIPTS' environment variable will be used.
+ base_paths = _bpy_script_paths()
- for path in base_paths + (script_path_user(), script_path_pref()):
+ if check_all:
+ # All possible paths, no duplicates, keep order.
+ base_paths = (
+ *(path for path in (_os.path.join(resource_path(res), "scripts")
+ for res in ('LOCAL', 'USER', 'SYSTEM')) if path not in base_paths),
+ *base_paths,
+ )
+
+ for path in (*base_paths, script_path_user(), script_path_pref()):
if path:
path = _os.path.normpath(path)
if path not in scripts and _os.path.isdir(path):
More information about the Bf-blender-cvs
mailing list