diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/asset/intern/asset_ops.cc | 42 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 2 |
3 files changed, 39 insertions, 10 deletions
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index c7644288959..8bd8a8f73c2 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -30,6 +30,7 @@ #include "BLI_fileops.h" #include "BLI_fnmatch.h" #include "BLI_path_util.h" +#include "BLI_set.hh" #include "ED_asset.h" #include "ED_asset_catalog.hh" @@ -877,7 +878,7 @@ static bool set_filepath_for_asset_lib(const Main *bmain, struct wmOperator *op) struct FileCheckCallbackInfo { struct ReportList *reports; - bool external_file_found; + Set<std::string> external_files; }; static bool external_file_check_callback(BPathForeachPathData *bpath_data, @@ -886,24 +887,20 @@ static bool external_file_check_callback(BPathForeachPathData *bpath_data, { FileCheckCallbackInfo *callback_info = static_cast<FileCheckCallbackInfo *>( bpath_data->user_data); - BKE_reportf(callback_info->reports, - RPT_ERROR, - "Unable to install asset bundle, has external dependency \"%s\"", - path_src); - callback_info->external_file_found = true; + callback_info->external_files.add(std::string(path_src)); return false; } /** * Do a check on any external files (.blend, textures, etc.) being used. - * The "Install asset bundle" operator only works on standalone .blend files + * The ASSET_OT_bundle_install operator only works on standalone .blend files * (catalog definition files are fine, though). * * \return true when there are external files, false otherwise. */ static bool has_external_files(Main *bmain, struct ReportList *reports) { - struct FileCheckCallbackInfo callback_info = {reports, false}; + struct FileCheckCallbackInfo callback_info = {reports, Set<std::string>()}; eBPathForeachFlag flag = static_cast<eBPathForeachFlag>( BKE_BPATH_FOREACH_PATH_SKIP_PACKED /* Packed files are fine. */ @@ -917,9 +914,34 @@ static bool has_external_files(Main *bmain, struct ReportList *reports) /* user_data */ &callback_info, /* absolute_base_path */ nullptr, }; - BKE_bpath_foreach_path_main(&bpath_data); - return callback_info.external_file_found; + + if (callback_info.external_files.is_empty()) { + /* No external dependencies. */ + return false; + } + + if (callback_info.external_files.size() == 1) { + /* Only one external dependency, report it directly. */ + BKE_reportf(callback_info.reports, + RPT_ERROR, + "Unable to copy bundle due to external dependency: \"%s\"", + callback_info.external_files.begin()->c_str()); + return true; + } + + /* Multiple external dependencies, report the aggregate and put details on console. */ + BKE_reportf( + callback_info.reports, + RPT_ERROR, + "Unable to copy bundle due to %ld external dependencies; more details on the console", + callback_info.external_files.size()); + printf("Unable to copy bundle due to %ld external dependencies:\n", + callback_info.external_files.size()); + for (const std::string &path : callback_info.external_files) { + printf(" \"%s\"\n", path.c_str()); + } + return true; } /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 34fad2bcbdb..1abdaa542c2 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -211,6 +211,11 @@ static FileSelect file_select_do(bContext *C, int selected_idx, bool do_diropen) filelist_setrecursion(sfile->files, params->recursion_level); } } + else if (file->redirection_path) { + BLI_strncpy(params->dir, file->redirection_path, sizeof(params->dir)); + BLI_path_normalize_dir(BKE_main_blendfile_path(bmain), params->dir); + BLI_path_slash_ensure(params->dir); + } else { BLI_path_normalize_dir(BKE_main_blendfile_path(bmain), params->dir); strcat(params->dir, file->relpath); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index e5009305fe5..285f6365ea1 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1941,6 +1941,8 @@ int rna_property_override_diff_default(Main *bmain, idx_a - 1); # endif op = NULL; + + equals = false; } else if (is_id || is_valid_for_diffing) { if (equals || do_create) { |