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:
authorPhilipp Oeser <info@graphics-engineer.com>2018-12-03 22:55:36 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2018-12-05 16:53:44 +0300
commit378e5232e88eb99c40025c681c9b28724a370c0f (patch)
treed4b47874429cfa15271617b17036ba0679f6e2ff /source/blender/blenkernel
parentfb3f1a35676e830358ec68ae8153e076253930b4 (diff)
Fix T58104: Duplicated previews for Matcaps/HDRIs in portable installs
Reviewers: brecht Maniphest Tasks: T58104 Differential Revision: https://developer.blender.org/D4028
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_appdir.h1
-rw-r--r--source/blender/blenkernel/intern/appdir.c4
-rw-r--r--source/blender/blenkernel/intern/studiolight.c15
3 files changed, 15 insertions, 5 deletions
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);