Blender
V3.3
|
#include <BKE_asset_catalog.hh>
Classes | |
struct | Flags |
Public Member Functions | |
AssetCatalog ()=default | |
AssetCatalog (CatalogID catalog_id, const AssetCatalogPath &path, const std::string &simple_name) | |
void | simple_name_refresh () |
Static Public Member Functions | |
static std::unique_ptr< AssetCatalog > | from_path (const AssetCatalogPath &path) |
Public Attributes | |
CatalogID | catalog_id |
AssetCatalogPath | path |
std::string | simple_name |
struct blender::bke::AssetCatalog::Flags | flags |
Static Protected Member Functions | |
static std::string | sensible_simple_name_for_path (const AssetCatalogPath &path) |
Asset Catalog definition, containing a symbolic ID and a path that points to a node in the catalog hierarchy.
Definition at line 424 of file BKE_asset_catalog.hh.
|
default |
blender::bke::AssetCatalog::AssetCatalog | ( | CatalogID | catalog_id, |
const AssetCatalogPath & | path, | ||
const std::string & | simple_name | ||
) |
Definition at line 1048 of file blenkernel/intern/asset_catalog.cc.
|
static |
Create a new Catalog with the given path, auto-generating a sensible catalog simple-name.
NOTE: the given path will be cleaned up (trailing spaces removed, etc.), so the returned AssetCatalog
's path differ from the given one.
Definition at line 1055 of file blenkernel/intern/asset_catalog.cc.
References BLI_uuid_generate_random(), blender::bke::AssetCatalogPath::cleanup(), path, sensible_simple_name_for_path(), and simple_name.
Referenced by blender::bke::AssetCatalogService::create_catalog(), and blender::bke::tests::TEST_F().
|
staticprotected |
Generate a sensible catalog ID for the given path.
Definition at line 1069 of file blenkernel/intern/asset_catalog.cc.
References MAX_NAME, path, blender::bke::AssetCatalogPath::SEPARATOR, and blender::bke::AssetCatalogPath::str().
Referenced by from_path(), and simple_name_refresh().
void blender::bke::AssetCatalog::simple_name_refresh | ( | ) |
Make a new simple name for the catalog, based on its path.
Definition at line 1064 of file blenkernel/intern/asset_catalog.cc.
References path, sensible_simple_name_for_path(), and simple_name.
Referenced by blender::bke::AssetCatalogService::update_catalog_path().
CatalogID blender::bke::AssetCatalog::catalog_id |
Definition at line 429 of file BKE_asset_catalog.hh.
Referenced by blender::bke::AssetCatalogDefinitionFile::add_new(), blender::bke::AssetCatalogDefinitionFile::add_overwrite(), asset_catalog_new_exec(), blender::bke::AssetCatalogTree::insert_item(), blender::bke::AssetCatalogLessThan::operator()(), blender::bke::AssetCatalogService::prune_catalogs_by_path(), blender::bke::tests::AssetCatalogTest::save_from_memory_into_existing_asset_lib(), and blender::bke::tests::TEST_F().
struct blender::bke::AssetCatalog::Flags blender::bke::AssetCatalog::flags |
Referenced by blender::bke::AssetCatalogService::create_missing_catalogs(), blender::bke::AssetCatalogService::delete_catalog_by_id_soft(), blender::bke::AssetCatalogTree::insert_item(), blender::bke::AssetCatalogLessThan::operator()(), blender::bke::AssetCatalogService::tag_has_unsaved_changes(), and blender::bke::tests::TEST_F().
AssetCatalogPath blender::bke::AssetCatalog::path |
Definition at line 430 of file BKE_asset_catalog.hh.
Referenced by blender::ed::asset_browser::AssetCatalogDropController::can_drop(), blender::bke::AssetCatalogService::create_catalog_filter(), ED_asset_catalog_move(), ED_asset_catalog_rename(), from_path(), blender::bke::AssetCatalogTree::insert_item(), blender::bke::AssetCatalogLessThan::operator()(), blender::bke::AssetCatalogService::prune_catalogs_by_id(), blender::bke::AssetCatalogService::prune_catalogs_by_path(), sensible_simple_name_for_path(), simple_name_refresh(), blender::bke::tests::TEST_F(), and blender::bke::AssetCatalogService::update_catalog_path().
std::string blender::bke::AssetCatalog::simple_name |
Simple, human-readable name for the asset catalog. This is stored on assets alongside the catalog ID; the catalog ID is a UUID that is not human-readable, so to avoid complete data-loss when the catalog definition file gets lost, we also store a human-readable simple name for the catalog.
It should fit in sizeof(AssetMetaData::catalog_simple_name) bytes.
Definition at line 438 of file BKE_asset_catalog.hh.
Referenced by from_path(), blender::bke::AssetCatalogTree::insert_item(), blender::bke::AssetLibrary::refresh_catalog_simplename(), simple_name_refresh(), and blender::bke::tests::TEST_F().