diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h index 6162c7b6bf6..8496c56a9c7 100644 --- a/source/blender/blenkernel/BKE_appdir.h +++ b/source/blender/blenkernel/BKE_appdir.h @@ -34,6 +34,7 @@ const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfold const char *BKE_appdir_folder_id_user_notest(const int folder_id, const char *subfolder); const char *BKE_appdir_folder_id_version(const int folder_id, const int ver, const bool do_check); +bool BKE_appdir_app_is_portable_install(void); bool BKE_appdir_app_template_any(void); bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len); void BKE_appdir_app_templates(struct ListBase *templates); diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c index 2848c245553..3643bf54e48 100644 --- a/source/blender/blenkernel/intern/appdir.c +++ b/source/blender/blenkernel/intern/appdir.c @@ -229,7 +229,7 @@ static bool get_path_local( * Is this an install with user files kept together with the Blender executable and its * installation files. */ -static bool is_portable_install(void) +bool BKE_appdir_app_is_portable_install(void) { /* detect portable install by the existence of config folder */ const int ver = BLENDER_VERSION; @@ -289,7 +289,7 @@ static bool get_path_user( const char *user_base_path; /* for portable install, user path is always local */ - if (is_portable_install()) { + if (BKE_appdir_app_is_portable_install()) { return get_path_local(targetpath, targetpath_len, folder_name, subfolder_name, ver); } user_path[0] = '\0'; diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 5196ae50bab..bd8061a2d8e 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -1219,13 +1219,22 @@ void BKE_studiolight_init(void) BLI_addtail(&studiolights, sl); /* go over the preset folder and add a studiolight for every image with its path */ + /* for portable installs (where USER and SYSTEM paths are the same), only go over LOCAL datafiles once */ /* Also reserve icon space for it. */ + if (!BKE_appdir_app_is_portable_install()) { + studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, + STUDIOLIGHT_LIGHTS_FOLDER, + STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_USER_DEFINED); + studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, + STUDIOLIGHT_WORLD_FOLDER, + STUDIOLIGHT_TYPE_WORLD | STUDIOLIGHT_USER_DEFINED); + studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, + STUDIOLIGHT_MATCAP_FOLDER, + STUDIOLIGHT_TYPE_MATCAP | STUDIOLIGHT_USER_DEFINED); + } studiolight_add_files_from_datafolder(BLENDER_SYSTEM_DATAFILES, STUDIOLIGHT_LIGHTS_FOLDER, STUDIOLIGHT_TYPE_STUDIO); - studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, STUDIOLIGHT_LIGHTS_FOLDER, STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_USER_DEFINED); studiolight_add_files_from_datafolder(BLENDER_SYSTEM_DATAFILES, STUDIOLIGHT_WORLD_FOLDER, STUDIOLIGHT_TYPE_WORLD); - studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, STUDIOLIGHT_WORLD_FOLDER, STUDIOLIGHT_TYPE_WORLD | STUDIOLIGHT_USER_DEFINED); studiolight_add_files_from_datafolder(BLENDER_SYSTEM_DATAFILES, STUDIOLIGHT_MATCAP_FOLDER, STUDIOLIGHT_TYPE_MATCAP); - studiolight_add_files_from_datafolder(BLENDER_USER_DATAFILES, STUDIOLIGHT_MATCAP_FOLDER, STUDIOLIGHT_TYPE_MATCAP | STUDIOLIGHT_USER_DEFINED); /* sort studio lights on filename. */ BLI_listbase_sort(&studiolights, studiolight_cmp);