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-22 17:29:31 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-22 17:31:32 +0300
commit70aad5f498fcd7ed52f3422edda3021e5d4f9538 (patch)
treebbd80c11425cd55ef01ad67e3a3e57768d1271b5 /source/blender/blenkernel/BKE_asset_library.hh
parent16ffa7bb6e519edd039683fe83031542d7059d96 (diff)
Asset Catalogs: support reloading without losing local changes
Keep track of unsaved asset catalog changes, in a more granular way than just one boolean per asset library. Individual catalogs can now be marked with a flag `has_unsaved_changes`. This is taken into account when reloading data from the catalog definition file (CDF): - New catalog in CDF: gets loaded - Already-known catalog in CDF: - local unsaved changes: on-disk catalog is ignored - otherwise: on-disk catalog replaces in-memory one - Already-known catalog that does not exist in CDF: - local unsaved changes: catalog is kept around - otherwise: catalog is deleted. Because this saving-is-also-loading behaviour, the "has unsaved changes" flags are all stored in the undo buffer; undoing after saving will not change the CDF, but at least it'll undo the loading from disk, and it'll re-mark any changes as "not saved". Reviewed By: Severin Differential Revision: https://developer.blender.org/D12967
Diffstat (limited to 'source/blender/blenkernel/BKE_asset_library.hh')
-rw-r--r--source/blender/blenkernel/BKE_asset_library.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 64c8afecaef..15f7991e75e 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -49,6 +49,9 @@ struct AssetLibrary {
void load(StringRefNull library_root_directory);
+ /** Load catalogs that have changed on disk. */
+ void refresh();
+
/**
* Update `catalog_simple_name` by looking up the asset's catalog by its ID.
*