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:
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_bpath.h3
-rw-r--r--source/blender/blenkernel/intern/bpath.c17
2 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_bpath.h b/source/blender/blenkernel/BKE_bpath.h
index 16a8b1be85b..55320b66054 100644
--- a/source/blender/blenkernel/BKE_bpath.h
+++ b/source/blender/blenkernel/BKE_bpath.h
@@ -65,7 +65,8 @@ void BKE_bpath_list_free(void *ls_handle);
/* creates a text file with missing files if there are any */
void BKE_bpath_missing_files_check(struct Main *bmain, struct ReportList *reports);
-void BKE_bpath_missing_files_find(struct Main *bmain, const char *searchpath, struct ReportList *reports);
+void BKE_bpath_missing_files_find(struct Main *bmain, const char *searchpath, struct ReportList *reports,
+ const bool find_all);
void BKE_bpath_relative_convert(struct Main *bmain, const char *basedir, struct ReportList *reports);
void BKE_bpath_absolute_convert(struct Main *bmain, const char *basedir, struct ReportList *reports);
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index fe86b413a99..a4cb7cbf628 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -263,8 +263,9 @@ static int findFileRecursive(char *filename_new,
typedef struct BPathFind_Data {
const char *basedir;
- char searchdir[FILE_MAX];
+ const char *searchdir;
ReportList *reports;
+ bool find_all;
} BPathFind_Data;
static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char *path_src)
@@ -276,6 +277,12 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
int recur_depth = 0;
int found;
+ if (data->find_all == false) {
+ if (BLI_exists(path_src)) {
+ return false;
+ }
+ }
+
filename_new[0] = '\0';
found = findFileRecursive(filename_new,
@@ -300,14 +307,16 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
}
}
-void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports)
+void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports,
+ const bool find_all)
{
struct BPathFind_Data data = {NULL};
data.reports = reports;
- BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir));
+ data.searchdir = searchpath;
+ data.find_all = find_all;
- BKE_bpath_traverse_main(bmain, findMissingFiles_visit_cb, 0, (void *)&data);
+ BKE_bpath_traverse_main(bmain, findMissingFiles_visit_cb, BKE_BPATH_TRAVERSE_ABS, (void *)&data);
}
/* Run a visitor on a string, replacing the contents of the string as needed. */