Blender V5.0
blender::asset_system::AssetCatalog Class Reference

#include <AS_asset_catalog.hh>

Classes

struct  Flags

Public Member Functions

 AssetCatalog ()=delete
 AssetCatalog (CatalogID catalog_id, const AssetCatalogPath &path, const std::string &simple_name)
void simple_name_refresh ()

Static Public Member Functions

static std::unique_ptr< AssetCatalogfrom_path (const AssetCatalogPath &path)

Public Attributes

const CatalogID catalog_id
AssetCatalogPath path
std::string simple_name
struct blender::asset_system::AssetCatalog::Flags flags

Static Protected Member Functions

static std::string sensible_simple_name_for_path (const AssetCatalogPath &path)

Detailed Description

Asset Catalog definition, containing a symbolic ID and a path that points to a node in the catalog hierarchy.

Warning
The asset system may reload catalogs, invalidating pointers. Thus it's not recommended to store pointers to asset catalogs. Store the CatalogID instead and do a lookup when needed.

Definition at line 301 of file AS_asset_catalog.hh.

Constructor & Destructor Documentation

◆ AssetCatalog() [1/2]

blender::asset_system::AssetCatalog::AssetCatalog ( )
delete

References catalog_id, path, and simple_name.

◆ AssetCatalog() [2/2]

blender::asset_system::AssetCatalog::AssetCatalog ( CatalogID catalog_id,
const AssetCatalogPath & path,
const std::string & simple_name )

Definition at line 683 of file asset_system/intern/asset_catalog.cc.

References catalog_id, path, and simple_name.

Member Function Documentation

◆ from_path()

std::unique_ptr< AssetCatalog > blender::asset_system::AssetCatalog::from_path ( const AssetCatalogPath & path)
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 690 of file asset_system/intern/asset_catalog.cc.

References BLI_uuid_generate_random(), path, sensible_simple_name_for_path(), and simple_name.

Referenced by blender::asset_system::AssetCatalogService::create_catalog(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().

◆ sensible_simple_name_for_path()

std::string blender::asset_system::AssetCatalog::sensible_simple_name_for_path ( const AssetCatalogPath & path)
staticprotected

Generate a sensible catalog ID for the given path.

Definition at line 704 of file asset_system/intern/asset_catalog.cc.

References MAX_NAME, name, path, and blender::asset_system::AssetCatalogPath::SEPARATOR.

Referenced by from_path(), and simple_name_refresh().

◆ simple_name_refresh()

void blender::asset_system::AssetCatalog::simple_name_refresh ( )

Make a new simple name for the catalog, based on its path.

Definition at line 699 of file asset_system/intern/asset_catalog.cc.

References path, sensible_simple_name_for_path(), and simple_name.

Referenced by blender::asset_system::AssetCatalogService::update_catalog_path().

Member Data Documentation

◆ catalog_id

const CatalogID blender::asset_system::AssetCatalog::catalog_id

Definition at line 303 of file AS_asset_catalog.hh.

Referenced by blender::asset_system::AssetCatalogDefinitionFile::add_new(), blender::asset_system::AssetCatalogDefinitionFile::add_overwrite(), blender::ed::asset::asset_catalog_new_exec(), AssetCatalog(), AssetCatalog(), blender::ed::sculpt_paint::brush_asset_edit_metadata_exec(), blender::ed::sculpt_paint::brush_asset_save_as_exec(), blender::ed::asset::shelf::catalog_filter_from_shelf_settings(), blender::ed::animrig::create_pose_asset_local(), blender::ed::animrig::create_pose_asset_user_library(), blender::asset_system::AssetCatalogTree::insert_item(), blender::asset_system::AssetCatalogLessThan::operator()(), blender::asset_system::AssetCatalogService::prune_catalogs_by_path(), blender::asset_system::tests::AssetCatalogTest::save_from_memory_into_existing_asset_lib(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().

◆ flags

◆ path

AssetCatalogPath blender::asset_system::AssetCatalog::path

◆ simple_name


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