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:
authorCampbell Barton <ideasman42@gmail.com>2021-12-13 08:22:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-12-13 08:22:19 +0300
commit8ad2642c4717dcfad31626f7eebac325a9827b73 (patch)
tree2d2ba09f1cd3849adb45eb51a590783a5a9eca02 /source/blender/editors/asset/intern
parent27231afce5e4d0832113415f4d3cdeed480b165f (diff)
Cleanup: use "filepath" term for Main, BlendFileData & FileGlobal
Use "filepath" which is the current convention for naming full paths. - Main use "name" which isn't obviously a file path. - BlendFileData & FileGlobal used "filename" which is often used for the name component of a path (without the directory).
Diffstat (limited to 'source/blender/editors/asset/intern')
-rw-r--r--source/blender/editors/asset/intern/asset_catalog.cc2
-rw-r--r--source/blender/editors/asset/intern/asset_ops.cc10
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/asset/intern/asset_catalog.cc b/source/blender/editors/asset/intern/asset_catalog.cc
index 787593d0a16..f6c02f86f0a 100644
--- a/source/blender/editors/asset/intern/asset_catalog.cc
+++ b/source/blender/editors/asset/intern/asset_catalog.cc
@@ -173,7 +173,7 @@ void ED_asset_catalogs_save_from_main_path(::AssetLibrary *library, const Main *
/* Since writing to disk also means loading any on-disk changes, it may be a good idea to store
* an undo step. */
catalog_service->undo_push();
- catalog_service->write_to_disk(bmain->name);
+ catalog_service->write_to_disk(bmain->filepath);
}
void ED_asset_catalogs_set_save_catalogs_when_file_is_saved(const bool should_save)
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc
index 4fec6e3d055..e4edff19a21 100644
--- a/source/blender/editors/asset/intern/asset_ops.cc
+++ b/source/blender/editors/asset/intern/asset_ops.cc
@@ -637,7 +637,7 @@ static bool asset_catalogs_save_poll(bContext *C)
}
const Main *bmain = CTX_data_main(C);
- if (!bmain->name[0]) {
+ if (!bmain->filepath[0]) {
CTX_wm_operator_poll_msg_set(C, "Cannot save asset catalogs before the Blender file is saved");
return false;
}
@@ -703,7 +703,7 @@ static bool asset_bundle_install_poll(bContext *C)
/* Check whether this file is already located inside any asset library. */
const struct bUserAssetLibrary *asset_lib = BKE_preferences_asset_library_containing_path(
- &U, bmain->name);
+ &U, bmain->filepath);
if (asset_lib) {
return false;
}
@@ -779,7 +779,7 @@ static int asset_bundle_install_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports,
RPT_INFO,
R"(Saved "%s" to asset library "%s")",
- BLI_path_basename(bmain->name),
+ BLI_path_basename(bmain->filepath),
lib->name);
return OPERATOR_FINISHED;
}
@@ -830,7 +830,7 @@ static void ASSET_OT_bundle_install(struct wmOperatorType *ot)
* referenced. */
static bool could_be_asset_bundle(const Main *bmain)
{
- return fnmatch("*_bundle.blend", bmain->name, FNM_CASEFOLD) == 0;
+ return fnmatch("*_bundle.blend", bmain->filepath, FNM_CASEFOLD) == 0;
}
static const bUserAssetLibrary *selected_asset_library(struct wmOperator *op)
@@ -864,7 +864,7 @@ static bool set_filepath_for_asset_lib(const Main *bmain, struct wmOperator *op)
}
/* Concatenate the filename of the current blend file. */
- const char *blend_filename = BLI_path_basename(bmain->name);
+ const char *blend_filename = BLI_path_basename(bmain->filepath);
if (blend_filename == nullptr || blend_filename[0] == '\0') {
return false;
}