Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_asset_library.hh
| Show All 27 Lines | |||||
| #include "BKE_asset_catalog.hh" | #include "BKE_asset_catalog.hh" | ||||
| #include "BKE_callbacks.h" | #include "BKE_callbacks.h" | ||||
| #include <memory> | #include <memory> | ||||
| namespace blender::bke { | namespace blender::bke { | ||||
| /** | |||||
| * AssetLibrary provides access to an asset library's data. | |||||
| * For now this is only for catalogs, later this can be expanded to indexes/caches/more. | |||||
| */ | |||||
| struct AssetLibrary { | struct AssetLibrary { | ||||
| std::unique_ptr<AssetCatalogService> catalog_service; | std::unique_ptr<AssetCatalogService> catalog_service; | ||||
| ~AssetLibrary(); | |||||
| void load(StringRefNull library_root_directory); | void load(StringRefNull library_root_directory); | ||||
| /** | /** | ||||
| * Update `catalog_simple_name` by looking up the asset's catalog by its ID. | * 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 | * 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 | * catalog definition file is corrupt/lost" scenario that the simple name is | ||||
| * meant to help recover from. */ | * meant to help recover from. */ | ||||
| void refresh_catalog_simplename(struct AssetMetaData *asset_data); | void refresh_catalog_simplename(struct AssetMetaData *asset_data); | ||||
| void on_save_handler_register(); | void on_save_handler_register(); | ||||
| void on_save_handler_unregister(); | void on_save_handler_unregister(); | ||||
| void on_save_post(struct Main *, struct PointerRNA **pointers, const int num_pointers); | void on_save_post(struct Main *, struct PointerRNA **pointers, const int num_pointers); | ||||
| private: | private: | ||||
| bCallbackFuncStore on_save_callback_store_; | bCallbackFuncStore on_save_callback_store_{}; | ||||
| }; | }; | ||||
| } // namespace blender::bke | } // namespace blender::bke | ||||
| blender::bke::AssetCatalogService *BKE_asset_library_get_catalog_service( | blender::bke::AssetCatalogService *BKE_asset_library_get_catalog_service( | ||||
| const ::AssetLibrary *library); | const ::AssetLibrary *library); | ||||
| blender::bke::AssetCatalogTree *BKE_asset_library_get_catalog_tree(const ::AssetLibrary *library); | blender::bke::AssetCatalogTree *BKE_asset_library_get_catalog_tree(const ::AssetLibrary *library); | ||||