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-10-12 18:53:05 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-12 19:07:58 +0300
commita6da1884ba9f4d3d37c98b48bc18a8d26dd489fc (patch)
tree5879311a882714ff4ca5fb45dfc141068509a866 /source/blender/blenkernel/BKE_asset_library.hh
parent5e3877e0c8560f27a5cd7b303666b235fb148165 (diff)
Asset Catalogs: Refresh catalog simple name when assigning catalog ID
When assigning a new catalog ID to an asset, also refresh the "catalog simple name". This "simple name" is stored on the asset metadata next to the catalog UUID, to allow some emergency data recovery when the catalog definition file is somehow lost.
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_library.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_library.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 1dc02f7aa9b..419df2a1061 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -38,6 +38,14 @@ struct AssetLibrary {
void load(StringRefNull library_root_directory);
+ /**
+ * Update `catalog_simple_name` by looking up the asset's catalog by its ID.
+ *
+ * No-op if the catalog cannot be found. This could be the kind of "the
+ * catalog definition file is corrupt/lost" scenario that the simple name is
+ * meant to help recover from. */
+ void refresh_catalog_simplename(struct AssetMetaData *asset_data);
+
void on_save_handler_register();
void on_save_handler_unregister();