Blender  V3.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
blender::bke::AssetLibrary Struct Reference

#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< AssetCatalogServicecatalog_service
 

Static Public Attributes

static bool save_catalogs_when_file_is_saved = true
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AssetLibrary()

blender::bke::AssetLibrary::AssetLibrary ( )

Definition at line 95 of file asset_library.cc.

◆ ~AssetLibrary()

blender::bke::AssetLibrary::~AssetLibrary ( )

Member Function Documentation

◆ load()

void blender::bke::AssetLibrary::load ( StringRefNull  library_root_directory)

Definition at line 106 of file asset_library.cc.

References catalog_service.

◆ on_blend_save_handler_register()

void blender::bke::AssetLibrary::on_blend_save_handler_register ( )

◆ on_blend_save_handler_unregister()

void blender::bke::AssetLibrary::on_blend_save_handler_unregister ( )

◆ on_blend_save_post()

void blender::bke::AssetLibrary::on_blend_save_post ( struct Main main,
struct PointerRNA **  pointers,
int  num_pointers 
)

◆ refresh()

void blender::bke::AssetLibrary::refresh ( )

Load catalogs that have changed on disk.

Definition at line 113 of file asset_library.cc.

References catalog_service.

◆ refresh_catalog_simplename()

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.

Member Data Documentation

◆ catalog_service

std::unique_ptr<AssetCatalogService> blender::bke::AssetLibrary::catalog_service

◆ save_catalogs_when_file_is_saved

bool blender::bke::AssetLibrary::save_catalogs_when_file_is_saved = true
static

The documentation for this struct was generated from the following files: