Blender  V3.3
Classes | Functions
blender::ed::asset::index Namespace Reference

Classes

class  AbstractFile
 
class  BlendFile
 Reference to a blend file that can be indexed. More...
 
struct  AssetEntryReader
 Single entry inside a #AssetIndexFile for reading. More...
 
struct  AssetEntryWriter
 
struct  AssetLibraryIndex
 References the asset library directory. More...
 
struct  AssetIndex
 
class  AssetIndexFile
 

Functions

constexpr StringRef ATTRIBUTE_VERSION ("version")
 Indexer for asset libraries. More...
 
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_TAGS ("tags")
 
constexpr StringRef ATTRIBUTE_ENTRIES_PROPERTIES ("properties")
 
static void init_value_from_file_indexer_entry (AssetEntryWriter &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 AssetEntryReader &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 voidinit_user_data (const char *root_directory, size_t root_directory_maxlen)
 
static void free_user_data (void *user_data)
 
static void filelist_finished (void *user_data)
 
constexpr FileIndexerType asset_indexer ()
 

Function Documentation

◆ asset_indexer()

constexpr FileIndexerType blender::ed::asset::index::asset_indexer ( )
constexpr

◆ ATTRIBUTE_ENTRIES()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES ( "entries"  )
constexpr

◆ ATTRIBUTE_ENTRIES_AUTHOR()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_AUTHOR ( "author"  )
constexpr

◆ ATTRIBUTE_ENTRIES_CATALOG_ID()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_CATALOG_ID ( "catalog_id"  )
constexpr

◆ ATTRIBUTE_ENTRIES_CATALOG_NAME()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_CATALOG_NAME ( "catalog_name"  )
constexpr

◆ ATTRIBUTE_ENTRIES_DESCRIPTION()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_DESCRIPTION ( "description"  )
constexpr

◆ ATTRIBUTE_ENTRIES_NAME()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_NAME ( "name"  )
constexpr

◆ ATTRIBUTE_ENTRIES_PROPERTIES()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_PROPERTIES ( "properties"  )
constexpr

◆ ATTRIBUTE_ENTRIES_TAGS()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_ENTRIES_TAGS ( "tags"  )
constexpr

◆ ATTRIBUTE_VERSION()

constexpr StringRef blender::ed::asset::index::ATTRIBUTE_VERSION ( "version"  )
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

{
"version": <file version number>,
"entries": [{
"name": "<asset name>",
"catalog_id": "<catalog_id>",
"catalog_name": "<catalog_name>",
"description": "<description>",
"author": "<author>",
"tags": ["<tag>"],
"properties": [..]
}]
}
FILE * file

NOTE: entries, author, description, 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().

◆ filelist_finished()

static void blender::ed::asset::index::filelist_finished ( void user_data)
static

◆ free_user_data()

static void blender::ed::asset::index::free_user_data ( void user_data)
static

Definition at line 768 of file asset_indexer.cc.

References user_data.

Referenced by asset_indexer().

◆ init_indexer_entries_from_value()

static int blender::ed::asset::index::init_indexer_entries_from_value ( FileIndexerEntries indexer_entries,
const DictionaryValue value 
)
static

◆ init_indexer_entry_from_value()

static void blender::ed::asset::index::init_indexer_entry_from_value ( FileIndexerEntry indexer_entry,
const AssetEntryReader entry 
)
static

◆ init_user_data()

static void* blender::ed::asset::index::init_user_data ( const char *  root_directory,
size_t  root_directory_maxlen 
)
static

◆ init_value_from_file_indexer_entries()

static void blender::ed::asset::index::init_value_from_file_indexer_entries ( DictionaryValue result,
const FileIndexerEntries indexer_entries 
)
static

◆ init_value_from_file_indexer_entry()

static void blender::ed::asset::index::init_value_from_file_indexer_entry ( AssetEntryWriter result,
const FileIndexerEntry indexer_entry 
)
static

◆ read_index()

static eFileIndexerResult blender::ed::asset::index::read_index ( const char *  filename,
FileIndexerEntries entries,
int *  r_read_entries_len,
void user_data 
)
static

◆ update_index()

static void blender::ed::asset::index::update_index ( const char *  filename,
FileIndexerEntries entries,
void user_data 
)
static