|
Blender V4.3
|
Classes | |
| class | AbstractFile |
| struct | AssetIndex |
| class | AssetIndexFile |
| struct | AssetLibraryIndex |
| References the asset library directory. More... | |
| class | BlendFile |
| Reference to a blend file that can be indexed. More... | |
Functions | |
| constexpr StringRef | ATTRIBUTE_VERSION ("version") |
| Indexer for asset libraries. | |
| constexpr StringRef | ATTRIBUTE_ENTRIES ("entries") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_NAME ("name") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_CATALOG_ID ("catalog_id") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_CATALOG_NAME ("catalog_name") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_DESCRIPTION ("description") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_AUTHOR ("author") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_COPYRIGHT ("copyright") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_LICENSE ("license") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_TAGS ("tags") |
| constexpr StringRef | ATTRIBUTE_ENTRIES_PROPERTIES ("properties") |
| static void | add_id_name (DictionaryValue &result, const short idcode, const StringRefNull name) |
| add id + name to the attributes. | |
| static void | init_value_from_file_indexer_entry (DictionaryValue &result, const FileIndexerEntry *indexer_entry) |
| static void | init_value_from_file_indexer_entries (DictionaryValue &result, const FileIndexerEntries &indexer_entries) |
| static void | init_indexer_entry_from_value (FileIndexerEntry &indexer_entry, const DictionaryValue &entry) |
| static int | init_indexer_entries_from_value (FileIndexerEntries &indexer_entries, const DictionaryValue &value) |
| static eFileIndexerResult | read_index (const char *filename, FileIndexerEntries *entries, int *r_read_entries_len, void *user_data) |
| static void | update_index (const char *filename, FileIndexerEntries *entries, void *user_data) |
| static void * | init_user_data (const char *root_directory, size_t root_directory_maxncpy) |
| static void | free_user_data (void *user_data) |
| static void | filelist_finished (void *user_data) |
| constexpr FileIndexerType | asset_indexer () |
Variables | |
| const FileIndexerType | file_indexer_asset = asset_indexer() |
|
static |
add id + name to the attributes.
NOTE: id and name are encoded like ID.name
Definition at line 143 of file asset_indexer.cc.
References ATTRIBUTE_ENTRIES_NAME().
Referenced by init_value_from_file_indexer_entry().
|
constexpr |
Definition at line 747 of file asset_indexer.cc.
References filelist_finished(), FileIndexerType::filelist_finished, free_user_data(), FileIndexerType::free_user_data, init_user_data(), FileIndexerType::init_user_data, read_index(), FileIndexerType::read_index, update_index(), and FileIndexerType::update_index.
|
constexpr |
Referenced by init_indexer_entries_from_value(), and init_value_from_file_indexer_entries().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by add_id_name(), and init_indexer_entry_from_value().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Referenced by init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
Indexer for asset libraries.
Indexes are stored per input file. Each index can contain zero to multiple asset entries. The indexes are grouped together per asset library. They are stored in BKE_appdir_folder_caches + /asset-library-indices/<asset-library-hash>/<asset-index-hash>_<asset_file>.index.json.
The structure of an index file is
NOTE: entries, author, description, copyright, license, tags and properties are optional attributes.
NOTE: File browser uses name and idcode separate. Inside the index they are joined together like ID.name. NOTE: File browser group name isn't stored in the index as it is a translatable name.
Referenced by blender::ed::asset::index::AssetIndex::AssetIndex(), and blender::ed::asset::index::AssetIndex::get_version().
|
static |
Definition at line 738 of file asset_indexer.cc.
References CLOG_INFO, LOG, and blender::ed::asset::index::AssetLibraryIndex::remove_unused_index_files().
Referenced by asset_indexer().
|
static |
Definition at line 733 of file asset_indexer.cc.
Referenced by asset_indexer().
|
static |
Definition at line 258 of file asset_indexer.cc.
References ATTRIBUTE_ENTRIES(), BLI_assert, BLI_linklist_prepend(), blender::io::serialize::ArrayValue::elements(), FileIndexerEntries::entries, init_indexer_entry_from_value(), and MEM_callocN.
Referenced by blender::ed::asset::index::AssetIndex::extract_into().
|
static |
Definition at line 215 of file asset_indexer.cc.
References BLODataBlockInfo::asset_data, ATTRIBUTE_ENTRIES_AUTHOR(), ATTRIBUTE_ENTRIES_CATALOG_ID(), ATTRIBUTE_ENTRIES_CATALOG_NAME(), ATTRIBUTE_ENTRIES_COPYRIGHT(), ATTRIBUTE_ENTRIES_DESCRIPTION(), ATTRIBUTE_ENTRIES_LICENSE(), ATTRIBUTE_ENTRIES_NAME(), ATTRIBUTE_ENTRIES_PROPERTIES(), ATTRIBUTE_ENTRIES_TAGS(), AssetMetaData::author, BKE_asset_metadata_create(), BKE_asset_metadata_tag_add(), BLI_strdupn(), blender::StringRefNull::c_str(), AssetMetaData::catalog_id, AssetMetaData::catalog_simple_name, blender::bke::idprop::convert_from_serialize_value(), blender::StringRefBase::copy(), AssetMetaData::copyright, blender::StringRefBase::data(), FileIndexerEntry::datablock_info, AssetMetaData::description, BLODataBlockInfo::free_asset_data, GS, FileIndexerEntry::idcode, AssetMetaData::license, blender::io::serialize::DictionaryValue::lookup(), blender::io::serialize::DictionaryValue::lookup_array(), blender::io::serialize::DictionaryValue::lookup_str(), BLODataBlockInfo::name, AssetMetaData::properties, STRNCPY_UTF8, and blender::StringRefBase::substr().
Referenced by init_indexer_entries_from_value().
|
static |
Definition at line 724 of file asset_indexer.cc.
References BLI_strnlen(), blender::ed::asset::index::AssetLibraryIndex::collect_preexisting_file_indices(), and blender::ed::asset::index::AssetLibraryIndex::remove_broken_index_files().
Referenced by asset_indexer().
|
static |
Definition at line 191 of file asset_indexer.cc.
References BLODataBlockInfo::asset_data, ATTRIBUTE_ENTRIES(), FileIndexerEntry::datablock_info, FileIndexerEntries::entries, and init_value_from_file_indexer_entry().
Referenced by blender::ed::asset::index::AssetIndex::AssetIndex().
|
static |
Definition at line 153 of file asset_indexer.cc.
References add_id_name(), blender::io::serialize::ArrayValue::append_array(), blender::io::serialize::ArrayValue::append_str(), BLODataBlockInfo::asset_data, ATTRIBUTE_ENTRIES_AUTHOR(), ATTRIBUTE_ENTRIES_CATALOG_ID(), ATTRIBUTE_ENTRIES_CATALOG_NAME(), ATTRIBUTE_ENTRIES_COPYRIGHT(), ATTRIBUTE_ENTRIES_DESCRIPTION(), ATTRIBUTE_ENTRIES_LICENSE(), ATTRIBUTE_ENTRIES_PROPERTIES(), ATTRIBUTE_ENTRIES_TAGS(), AssetMetaData::author, BLI_listbase_is_empty(), AssetMetaData::catalog_id, AssetMetaData::catalog_simple_name, blender::bke::idprop::convert_to_serialize_values(), AssetMetaData::copyright, FileIndexerEntry::datablock_info, AssetMetaData::description, FileIndexerEntry::idcode, AssetMetaData::license, LISTBASE_FOREACH, BLODataBlockInfo::name, AssetMetaData::properties, and AssetMetaData::tags.
Referenced by init_value_from_file_indexer_entries().
|
static |
Definition at line 648 of file asset_indexer.cc.
References CLOG_INFO, blender::ed::asset::index::AssetIndexFile::constains_entries(), blender::ed::asset::index::AssetIndex::CURRENT_VERSION, blender::ed::asset::index::AbstractFile::exists(), FILE_INDEXER_ENTRIES_LOADED, FILE_INDEXER_NEEDS_UPDATE, blender::ed::asset::index::AssetIndexFile::filename, blender::ed::asset::index::AssetIndexFile::is_older_than(), LOG, blender::ed::asset::index::AssetIndexFile::mark_as_used(), and blender::ed::asset::index::AssetIndexFile::read_contents().
Referenced by asset_indexer().
|
static |
Definition at line 709 of file asset_indexer.cc.
References CLOG_INFO, blender::ed::asset::index::AssetIndexFile::get_file_path(), blender::ed::asset::index::BlendFile::get_file_path(), LOG, and blender::ed::asset::index::AssetIndexFile::write_contents().
Referenced by asset_indexer().
| const FileIndexerType blender::ed::asset::index::file_indexer_asset = asset_indexer() |
File Indexer Service for indexing asset files.
Opening and parsing a large collection of asset files inside a library can take a lot of time. To reduce the time it takes the files are indexed.
BKE_appdir_folder_caches + asset_library_indexes/{asset_library_dir}/{asset_index_file.json}).Definition at line 758 of file asset_indexer.cc.
Referenced by blender::ed::asset::list::AssetList::setup().