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>2020-01-28 08:15:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-28 08:15:38 +0300
commit051d2240655290140343c0e88e886eea0ba70e24 (patch)
tree3544a8e8f203df0ebfa1d8d5d852420eb8e61ff5 /release
parentddda73b98a9c0a45e4fec667ba4021cec456d030 (diff)
parenteb6cb67ab68679ac80a0f8886879c42cf6953d98 (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy/utils/__init__.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py
index ae1e3495cba..9404c78c565 100644
--- a/release/scripts/modules/bpy/utils/__init__.py
+++ b/release/scripts/modules/bpy/utils/__init__.py
@@ -409,26 +409,18 @@ def app_template_paths(subdir=None):
:return: app template paths.
:rtype: generator
"""
- # Note: keep in sync with: Blender's BKE_appdir_app_template_any
-
- subdir_tuple = (subdir,) if subdir is not None else ()
-
- # Avoid adding 'bl_app_templates_system' twice.
- # Either we have a portable build or an installed system build.
- for resource_type, module_name in (
- ('USER', "bl_app_templates_user"),
- ('LOCAL', "bl_app_templates_system"),
- ('SYSTEM', "bl_app_templates_system"),
+ subdir_args = (subdir,) if subdir is not None else ()
+ # Note: keep in sync with: Blender's 'BKE_appdir_app_template_any'.
+ # Uses 'BLENDER_USER_SCRIPTS', 'BLENDER_SYSTEM_SCRIPTS'
+ # ... in this case 'system' accounts for 'local' too.
+ scripts_system, scripts_user = _bpy_script_paths()
+ for resource_fn, module_name in (
+ (_user_resource, "bl_app_templates_user"),
+ (system_resource, "bl_app_templates_system"),
):
- path = resource_path(resource_type)
- if path:
- path = _os.path.join(
- *(path, "scripts", "startup", module_name, *subdir_tuple))
- if _os.path.isdir(path):
- yield path
- # Only load LOCAL or SYSTEM (never both).
- if resource_type == 'LOCAL':
- break
+ path = resource_fn('SCRIPTS', _os.path.join("startup", module_name, *subdir_args))
+ if path and _os.path.isdir(path):
+ yield path
def preset_paths(subdir):