|
Blender V4.5
|
Classes | |
| class | AbstractFile |
| class | BlendFile |
| Reference to a blend file that can be indexed. More... | |
| struct | AssetLibraryIndex |
| References the asset library directory. More... | |
| struct | AssetIndex |
| class | AssetIndexFile |
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 add_id_name(), ATTRIBUTE_ENTRIES_NAME(), and result.
Referenced by add_id_name(), and init_value_from_file_indexer_entry().
|
constexpr |
Definition at line 746 of file asset_indexer.cc.
References asset_indexer(), 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.
Referenced by asset_indexer().
|
constexpr |
References ATTRIBUTE_ENTRIES().
Referenced by ATTRIBUTE_ENTRIES(), init_indexer_entries_from_value(), and init_value_from_file_indexer_entries().
|
constexpr |
References ATTRIBUTE_ENTRIES_AUTHOR().
Referenced by ATTRIBUTE_ENTRIES_AUTHOR(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_CATALOG_ID().
Referenced by ATTRIBUTE_ENTRIES_CATALOG_ID(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_CATALOG_NAME().
Referenced by ATTRIBUTE_ENTRIES_CATALOG_NAME(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_COPYRIGHT().
Referenced by ATTRIBUTE_ENTRIES_COPYRIGHT(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_DESCRIPTION().
Referenced by ATTRIBUTE_ENTRIES_DESCRIPTION(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_LICENSE().
Referenced by ATTRIBUTE_ENTRIES_LICENSE(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_NAME().
Referenced by add_id_name(), ATTRIBUTE_ENTRIES_NAME(), and init_indexer_entry_from_value().
|
constexpr |
References ATTRIBUTE_ENTRIES_PROPERTIES().
Referenced by ATTRIBUTE_ENTRIES_PROPERTIES(), init_indexer_entry_from_value(), and init_value_from_file_indexer_entry().
|
constexpr |
References ATTRIBUTE_ENTRIES_TAGS().
Referenced by ATTRIBUTE_ENTRIES_TAGS(), 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.
References ATTRIBUTE_VERSION().
Referenced by blender::ed::asset::index::AssetIndex::AssetIndex(), ATTRIBUTE_VERSION(), and blender::ed::asset::index::AssetIndex::get_version().
|
static |
Definition at line 737 of file asset_indexer.cc.
References CLOG_INFO, filelist_finished(), LOG, and blender::ed::asset::index::AssetLibraryIndex::remove_unused_index_files().
Referenced by asset_indexer(), and filelist_finished().
|
static |
Definition at line 732 of file asset_indexer.cc.
References free_user_data().
Referenced by asset_indexer(), and free_user_data().
|
static |
Definition at line 258 of file asset_indexer.cc.
References ATTRIBUTE_ENTRIES(), BLI_assert, BLI_linklist_prepend(), element, blender::io::serialize::ArrayValue::elements(), FileIndexerEntries::entries, init_indexer_entries_from_value(), init_indexer_entry_from_value(), blender::io::serialize::DictionaryValue::lookup_array(), and MEM_callocN().
Referenced by blender::ed::asset::index::AssetIndex::extract_into(), and init_indexer_entries_from_value().
|
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_utf8_truncated(), AssetMetaData::copyright, blender::StringRefBase::data(), FileIndexerEntry::datablock_info, AssetMetaData::description, BLODataBlockInfo::free_asset_data, GS, FileIndexerEntry::idcode, init_indexer_entry_from_value(), 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(), and init_indexer_entry_from_value().
|
static |
Definition at line 723 of file asset_indexer.cc.
References BLI_strnlen(), blender::ed::asset::index::AssetLibraryIndex::collect_preexisting_file_indices(), init_user_data(), blender::ed::asset::index::AssetLibraryIndex::remove_broken_index_files(), and blender::StringRef::StringRef().
Referenced by asset_indexer(), and init_user_data().
|
static |
Definition at line 191 of file asset_indexer.cc.
References BLODataBlockInfo::asset_data, ATTRIBUTE_ENTRIES(), FileIndexerEntry::datablock_info, FileIndexerEntries::entries, init_value_from_file_indexer_entries(), init_value_from_file_indexer_entry(), LinkNode::next, and result.
Referenced by blender::ed::asset::index::AssetIndex::AssetIndex(), and init_value_from_file_indexer_entries().
|
static |
Definition at line 153 of file asset_indexer.cc.
References add_id_name(), 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, init_value_from_file_indexer_entry(), AssetMetaData::license, LISTBASE_FOREACH, BLODataBlockInfo::name, AssetMetaData::properties, result, blender::bUUID::str(), and AssetMetaData::tags.
Referenced by init_value_from_file_indexer_entries(), and init_value_from_file_indexer_entry().
|
static |
Definition at line 647 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(), blender::ed::asset::index::AssetIndexFile::read_contents(), and read_index().
Referenced by asset_indexer(), and read_index().
|
static |
Definition at line 708 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, update_index(), and blender::ed::asset::index::AssetIndexFile::write_contents().
Referenced by asset_indexer(), and update_index().
| 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.
Definition at line 757 of file asset_indexer.cc.
Referenced by file_refresh(), and blender::ed::asset::list::AssetList::setup().