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:
authorSybren A. Stüvel <sybren@blender.org>2021-09-27 16:28:16 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-27 19:14:21 +0300
commit10061ee18ae97968bc9e0a7d83a353b077329aca (patch)
tree322d58f7c54bed5a3b642937fff0c0dc793864e0 /source/blender/blenkernel/BKE_asset_library.hh
parent90aa0a52568c629e466b6ccc513afadd0144ee1e (diff)
Asset Catalogs: write catalogs to disk when saving the blend file
The Asset Catalog Definition File is now saved whenever the blend file is saved. The location of the CDF depends on where the blend file is saved, and whether previously a CDF was already loaded, according to the following rules. The first matching rule wins: 1. Already loaded a CDF from disk? -> Always write to that file. 2. The directory containing the blend file has a `blender_assets.cats.txt` file? -> Merge with & write to that file. 3. The directory containing the blend file is part of an asset library, as per the user's preferences? -> Merge with & write to `${ASSET_LIBRARY_ROOT}/blender_assets.cats.txt` 4. Create a new file `blender_assets.cats.txt` next to the blend file.
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_library.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_library.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 68f7481574e..fc5e137dd3e 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -27,6 +27,7 @@
#include "BKE_asset_library.h"
#include "BKE_asset_catalog.hh"
+#include "BKE_callbacks.h"
#include <memory>
@@ -36,6 +37,14 @@ struct AssetLibrary {
std::unique_ptr<AssetCatalogService> catalog_service;
void load(StringRefNull library_root_directory);
+
+ void on_save_handler_register();
+ void on_save_handler_unregister();
+
+ void on_save_post(struct Main *, struct PointerRNA **pointers, const int num_pointers);
+
+ private:
+ bCallbackFuncStore on_save_callback_store_;
};
} // namespace blender::bke