Blender V4.3
BKE_asset.hh File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_utildefines.h"
#include "DNA_asset_types.h"

Go to the source code of this file.

Classes

struct  AssetTypeInfo
 
struct  AssetTagEnsureResult
 

Typedefs

using PreSaveFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)
 
using OnMarkAssetFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)
 
using OnClearAssetDataFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)
 

Functions

AssetMetaDataBKE_asset_metadata_create ()
 
void BKE_asset_metadata_free (AssetMetaData **asset_data)
 
AssetMetaDataBKE_asset_metadata_copy (const AssetMetaData *source)
 
AssetTagBKE_asset_metadata_tag_add (AssetMetaData *asset_data, const char *name) ATTR_NONNULL(1
 
AssetTag AssetTagEnsureResult BKE_asset_metadata_tag_ensure (AssetMetaData *asset_data, const char *name)
 
void BKE_asset_metadata_tag_remove (AssetMetaData *asset_data, AssetTag *tag)
 
void BKE_asset_metadata_catalog_id_clear (AssetMetaData *asset_data)
 
void BKE_asset_metadata_catalog_id_set (AssetMetaData *asset_data, bUUID catalog_id, const char *catalog_simple_name)
 
void BKE_asset_library_reference_init_default (AssetLibraryReference *library_ref)
 
void BKE_asset_metadata_idprop_ensure (AssetMetaData *asset_data, IDProperty *prop)
 
IDPropertyBKE_asset_metadata_idprop_find (const AssetMetaData *asset_data, const char *name) ATTR_WARN_UNUSED_RESULT
 
PreviewImageBKE_asset_metadata_preview_get_from_id (const AssetMetaData *asset_data, const ID *owner_id)
 
void BKE_asset_metadata_write (BlendWriter *writer, AssetMetaData *asset_data)
 
void BKE_asset_metadata_read (BlendDataReader *reader, AssetMetaData *asset_data)
 
void BKE_asset_weak_reference_write (BlendWriter *writer, const AssetWeakReference *weak_ref)
 
void BKE_asset_weak_reference_read (BlendDataReader *reader, AssetWeakReference *weak_ref)
 
void BKE_asset_catalog_path_list_free (ListBase &catalog_path_list)
 
ListBase BKE_asset_catalog_path_list_duplicate (const ListBase &catalog_path_list)
 
void BKE_asset_catalog_path_list_blend_write (BlendWriter *writer, const ListBase &catalog_path_list)
 
void BKE_asset_catalog_path_list_blend_read_data (BlendDataReader *reader, ListBase &catalog_path_list)
 
bool BKE_asset_catalog_path_list_has_path (const ListBase &catalog_path_list, const char *catalog_path)
 
void BKE_asset_catalog_path_list_add_path (ListBase &catalog_path_list, const char *catalog_path)
 

Typedef Documentation

◆ OnClearAssetDataFn

using OnClearAssetDataFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)

Definition at line 27 of file BKE_asset.hh.

◆ OnMarkAssetFn

using OnMarkAssetFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)

Definition at line 26 of file BKE_asset.hh.

◆ PreSaveFn

using PreSaveFn = void (*)(void *asset_ptr, AssetMetaData *asset_data)

Definition at line 25 of file BKE_asset.hh.

Function Documentation

◆ BKE_asset_catalog_path_list_add_path()

void BKE_asset_catalog_path_list_add_path ( ListBase & catalog_path_list,
const char * catalog_path )

◆ BKE_asset_catalog_path_list_blend_read_data()

void BKE_asset_catalog_path_list_blend_read_data ( BlendDataReader * reader,
ListBase & catalog_path_list )

◆ BKE_asset_catalog_path_list_blend_write()

void BKE_asset_catalog_path_list_blend_write ( BlendWriter * writer,
const ListBase & catalog_path_list )

◆ BKE_asset_catalog_path_list_duplicate()

ListBase BKE_asset_catalog_path_list_duplicate ( const ListBase & catalog_path_list)

◆ BKE_asset_catalog_path_list_free()

void BKE_asset_catalog_path_list_free ( ListBase & catalog_path_list)

◆ BKE_asset_catalog_path_list_has_path()

bool BKE_asset_catalog_path_list_has_path ( const ListBase & catalog_path_list,
const char * catalog_path )

◆ BKE_asset_library_reference_init_default()

void BKE_asset_library_reference_init_default ( AssetLibraryReference * library_ref)

Definition at line 149 of file asset.cc.

References DNA_struct_default_get.

Referenced by blo_do_versions_300(), and workspace_init_data().

◆ BKE_asset_metadata_catalog_id_clear()

void BKE_asset_metadata_catalog_id_clear ( AssetMetaData * asset_data)

Clean up the catalog ID (white-spaces removed, length reduced, etc.) and assign it.

Definition at line 154 of file asset.cc.

References BLI_uuid_nil(), AssetMetaData::catalog_id, and AssetMetaData::catalog_simple_name.

Referenced by blender::bke::tests::TEST().

◆ BKE_asset_metadata_catalog_id_set()

◆ BKE_asset_metadata_copy()

AssetMetaData * BKE_asset_metadata_copy ( const AssetMetaData * source)

Create a copy of the AssetMetaData so that it can be assigned to another asset.

The caller becomes the owner of the returned pointer.

Definition at line 44 of file asset.cc.

Referenced by BKE_libblock_copy_in_lib(), and blender::ed::asset::copy_to_id().

◆ BKE_asset_metadata_create()

AssetMetaData * BKE_asset_metadata_create ( )

◆ BKE_asset_metadata_free()

◆ BKE_asset_metadata_idprop_ensure()

◆ BKE_asset_metadata_idprop_find()

◆ BKE_asset_metadata_preview_get_from_id()

PreviewImage * BKE_asset_metadata_preview_get_from_id ( const AssetMetaData * asset_data,
const ID * owner_id )

Definition at line 196 of file asset.cc.

References BKE_previewimg_id_get().

Referenced by filelist_readjob_main_assets_add_items().

◆ BKE_asset_metadata_read()

◆ BKE_asset_metadata_tag_add()

AssetTag * BKE_asset_metadata_tag_add ( AssetMetaData * asset_data,
const char * name )

◆ BKE_asset_metadata_tag_ensure()

AssetTag AssetTagEnsureResult BKE_asset_metadata_tag_ensure ( AssetMetaData * asset_data,
const char * name )

Make sure there is a tag with name name, create one if needed.

Definition at line 118 of file asset.cc.

References asset_metadata_tag_add(), BLI_findstring(), offsetof, result, and AssetMetaData::tags.

◆ BKE_asset_metadata_tag_remove()

void BKE_asset_metadata_tag_remove ( AssetMetaData * asset_data,
AssetTag * tag )

◆ BKE_asset_metadata_write()

◆ BKE_asset_weak_reference_read()

void BKE_asset_weak_reference_read ( BlendDataReader * reader,
AssetWeakReference * weak_ref )

◆ BKE_asset_weak_reference_write()

void BKE_asset_weak_reference_write ( BlendWriter * writer,
const AssetWeakReference * weak_ref )