Blender
V3.3
|
Go to the source code of this file.
Typedefs | |
typedef struct AssetLibrary | AssetLibrary |
Functions | |
struct AssetLibrary * | BKE_asset_library_load (const char *library_path) |
bool | BKE_asset_library_find_suitable_root_path_from_path (const char *input_path, char r_library_path[768]) |
bool | BKE_asset_library_find_suitable_root_path_from_main (const struct Main *bmain, char r_library_path[768]) |
void | BKE_asset_library_refresh_catalog_simplename (struct AssetLibrary *asset_library, struct AssetMetaData *asset_data) |
bool | BKE_asset_library_has_any_unsaved_catalogs (void) |
typedef struct AssetLibrary AssetLibrary |
Forward declaration, defined in intern/asset_library.hh
Definition at line 1 of file BKE_asset_library.h.
bool BKE_asset_library_find_suitable_root_path_from_main | ( | const struct Main * | bmain, |
char | r_library_path[768] | ||
) |
Uses the current location on disk of the file represented by bmain as input to BKE_asset_library_find_suitable_root_path_from_path(). Refer to it for a design description.
Referenced by filelist_asset_library_path().
bool BKE_asset_library_find_suitable_root_path_from_path | ( | const char * | input_path, |
char | r_library_path[768] | ||
) |
Try to find an appropriate location for an asset library root from a file or directory path. Does not check if input_path exists.
The design is made to find an appropriate asset library path from a .blend file path, but technically works with any file or directory as input_path. Design is:
r_library_path | The returned asset library path with a trailing slash, or an empty string if no suitable path is found. Assumed to be a buffer of at least FILE_MAXDIR bytes. |
Referenced by blender::bke::AssetCatalogService::find_suitable_cdf_path_for_writing().
Return whether any loaded AssetLibrary has unsaved changes to its catalogs.
Definition at line 39 of file asset_library.cc.
References blender::bke::AssetLibraryService::get(), and blender::bke::AssetLibraryService::has_any_unsaved_catalogs().
Referenced by asset_catalogs_save_poll(), block_create__close_file_dialog(), and wm_file_or_session_data_has_unsaved_changes().
struct AssetLibrary* BKE_asset_library_load | ( | const char * | library_path | ) |
Return the AssetLibrary rooted at the given directory path.
Will return the same pointer for repeated calls, until another blend file is loaded.
To get the in-memory-only "current file" asset library, pass an empty path.
Loading an asset library at this point only means loading the catalogs. Later on this should invoke reading of asset representations too.
Definition at line 26 of file asset_library.cc.
References blender::bke::AssetLibraryService::get(), blender::bke::AssetLibraryService::get_asset_library_current_file(), blender::bke::AssetLibraryService::get_asset_library_on_disk(), and lib.
Referenced by filelist_readjob_load_asset_library_data(), and blender::bke::tests::TEST_F().
void BKE_asset_library_refresh_catalog_simplename | ( | struct AssetLibrary * | asset_library, |
struct AssetMetaData * | asset_data | ||
) |
Look up the asset's catalog and copy its simple name into #asset_data.
Definition at line 86 of file asset_library.cc.
References lib.