Blender
V3.3
|
#include <BKE_asset_library.hh>
Public Member Functions | |
AssetLibrary () | |
~AssetLibrary () | |
void | load (StringRefNull library_root_directory) |
void | refresh () |
void | refresh_catalog_simplename (struct AssetMetaData *asset_data) |
void | on_blend_save_handler_register () |
void | on_blend_save_handler_unregister () |
void | on_blend_save_post (struct Main *, struct PointerRNA **pointers, int num_pointers) |
Public Attributes | |
std::unique_ptr< AssetCatalogService > | catalog_service |
Static Public Attributes | |
static bool | save_catalogs_when_file_is_saved = true |
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.
Definition at line 26 of file BKE_asset_library.hh.
blender::bke::AssetLibrary::AssetLibrary | ( | ) |
Definition at line 95 of file asset_library.cc.
blender::bke::AssetLibrary::~AssetLibrary | ( | ) |
Definition at line 99 of file asset_library.cc.
References bCallbackFuncStore::func, and on_blend_save_handler_unregister().
void blender::bke::AssetLibrary::load | ( | StringRefNull | library_root_directory | ) |
Definition at line 106 of file asset_library.cc.
References catalog_service.
void blender::bke::AssetLibrary::on_blend_save_handler_register | ( | ) |
Definition at line 130 of file asset_library.cc.
References bCallbackFuncStore::alloc, bCallbackFuncStore::arg, BKE_callback_add(), BKE_CB_EVT_SAVE_POST, and bCallbackFuncStore::func.
void blender::bke::AssetLibrary::on_blend_save_handler_unregister | ( | ) |
Definition at line 141 of file asset_library.cc.
References bCallbackFuncStore::arg, BKE_callback_remove(), BKE_CB_EVT_SAVE_POST, and bCallbackFuncStore::func.
Referenced by ~AssetLibrary().
void blender::bke::AssetLibrary::on_blend_save_post | ( | struct Main * | main, |
struct PointerRNA ** | pointers, | ||
int | num_pointers | ||
) |
Definition at line 148 of file asset_library.cc.
References catalog_service, Main::filepath, and save_catalogs_when_file_is_saved.
void blender::bke::AssetLibrary::refresh | ( | ) |
Load catalogs that have changed on disk.
Definition at line 113 of file asset_library.cc.
References catalog_service.
void blender::bke::AssetLibrary::refresh_catalog_simplename | ( | struct AssetMetaData * | asset_data | ) |
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.
Definition at line 161 of file asset_library.cc.
References BLI_uuid_is_nil(), AssetMetaData::catalog_id, catalog_service, AssetMetaData::catalog_simple_name, blender::bke::AssetCatalog::simple_name, and STRNCPY.
std::unique_ptr<AssetCatalogService> blender::bke::AssetLibrary::catalog_service |
Definition at line 31 of file BKE_asset_library.hh.
Referenced by load(), on_blend_save_post(), refresh(), refresh_catalog_simplename(), and blender::bke::tests::TEST_F().
|
static |
Definition at line 29 of file BKE_asset_library.hh.
Referenced by ED_asset_catalogs_get_save_catalogs_when_file_is_saved(), ED_asset_catalogs_set_save_catalogs_when_file_is_saved(), and on_blend_save_post().