98 if (embedded_node_tree !=
NULL) {
126 const char *path_src;
129 if (absolute_base_path) {
130 BLI_strncpy(path_src_buf, path,
sizeof(path_src_buf));
132 path_src = path_src_buf;
163 if (absolute_base_path) {
167 if (bpath_data->
callback_function(bpath_data, path_dst, (
const char *)path_src)) {
180 const char *path_src;
183 if (absolute_base_path) {
184 BLI_strncpy(path_src_buf, *path,
sizeof(path_src_buf));
186 path_src = path_src_buf;
209 const char *path_src)
227 .user_data = reports});
236 #define MAX_DIR_RECURSE 16
237 #define FILESIZE_INVALID_DIRECTORY -1
254 const char *filename_src,
257 int *r_recurse_depth)
267 dir =
opendir(search_directory);
284 if (
BLI_stat(path, &status) == -1) {
285 CLOG_WARN(&
LOG,
"Cannot get file status (`stat()`) of '%s'", path);
291 size = status.st_size;
292 if ((
size > 0) && (
size > *r_filesize)) {
299 else if (
S_ISDIR(status.st_mode)) {
301 (*r_recurse_depth)++;
303 path, filename_src, r_filename_new, r_filesize, r_recurse_depth);
304 (*r_recurse_depth)--;
322 const char *path_src)
328 int recurse_depth = 0;
335 filename_new[0] =
'\0';
343 "Could not open the directory '%s'",
347 if (is_found ==
false) {
350 "Could not find '%s' in '%s'",
369 const char *searchpath,
379 data.searchdir = searchpath;
386 .user_data = &
data});
389 #undef MAX_DIR_RECURSE
390 #undef FILESIZE_INVALID_DIRECTORY
410 const char *path_src)
425 data->count_failed++;
435 data->count_changed++;
440 const char *basedir_src,
441 const char *basedir_dst,
450 data.basedir_src = basedir_src;
451 data.basedir_dst = basedir_dst;
452 data.reports = reports;
458 .user_data = &
data});
462 "Total files %d | Changed %d | Failed %d",
485 const char *path_src)
498 data->count_changed++;
502 data->count_failed++;
509 const char *path_src)
522 data->count_changed++;
526 data->count_failed++;
540 if (basedir[0] ==
'\0') {
545 data.basedir = basedir;
546 data.reports = reports;
549 .bmain = bmain, .callback_function = callback_function, .flag = flag, .user_data = &
data});
553 "Total files %d | Changed %d | Failed %d",
582 const char *path_src)
585 size_t path_size = strlen(path_src) + 1;
589 char *filepath = (
char *)(path_store + 1);
598 const char *path_src)
607 const char *filepath = (
char *)(path_store + 1);
608 bool is_path_changed =
false;
610 if (!
STREQ(path_src, filepath)) {
612 is_path_changed =
true;
616 return is_path_changed;
626 .user_data = path_list});
633 ListBase *path_list = path_list_handle;
638 .user_data = path_list});
643 ListBase *path_list = path_list_handle;
bool(* BPathForeachPathFunctionCallback)(struct BPathForeachPathData *bpath_data, char *r_path_dst, const char *path_src)
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
@ BKE_BPATH_FOREACH_PATH_SKIP_LINKED
@ BKE_BPATH_FOREACH_PATH_ABSOLUTE
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
const struct IDTypeInfo * BKE_idtype_get_info_from_id(const struct ID *id)
#define FOREACH_MAIN_ID_END
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
struct bNodeTree * ntreeFromID(struct ID *id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen)
void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2)
#define FILENAME_IS_CURRPAR(_n)
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL()
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Compatibility-like things for windows.
struct dirent * readdir(DIR *dp)
DIR * opendir(const char *path)
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define ID_IS_LINKED(_id)
#define ID_BLEND_PATH(_bmain, _id)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
void BKE_bpath_relative_rebase(Main *bmain, const char *basedir_src, const char *basedir_dst, ReportList *reports)
void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports)
static bool missing_files_find_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
static bool absolute_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path)
static bool relative_rebase_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
bool BKE_bpath_foreach_path_dirfile_fixed_process(BPathForeachPathData *bpath_data, char *path_dir, char *path_file)
static bool check_missing_files_foreach_path_cb(BPathForeachPathData *bpath_data, char *UNUSED(path_dst), const char *path_src)
void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports)
void * BKE_bpath_list_backup(Main *bmain, const eBPathForeachFlag flag)
struct BPathRemap_Data BPathRemap_Data
void BKE_bpath_list_restore(Main *bmain, const eBPathForeachFlag flag, void *path_list_handle)
static bool bpath_list_append(BPathForeachPathData *bpath_data, char *UNUSED(path_dst), const char *path_src)
static bool bpath_list_restore(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
struct BPathRebase_Data BPathRebase_Data
static bool missing_files_find__recursive(const char *search_directory, const char *filename_src, char r_filename_new[FILE_MAX], int64_t *r_filesize, int *r_recurse_depth)
static void bpath_absolute_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathForeachPathFunctionCallback callback_function)
static bool relative_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
void BKE_bpath_list_free(void *path_list_handle)
struct BPathFind_Data BPathFind_Data
#define FILESIZE_INVALID_DIRECTORY
void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports)
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports, const bool find_all)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
const char * absolute_base_path
BPathForeachPathFunctionCallback callback_function
IDTypeForeachPathFunction foreach_path
struct LibraryWeakReference * library_weak_reference
char library_filepath[1024]