33 return MEM_new<AssetMetaData>(__func__);
38 MEM_delete(*asset_data);
39 *asset_data =
nullptr;
44 return MEM_new<AssetMetaData>(__func__, *source);
47AssetMetaData::AssetMetaData(
const AssetMetaData &other)
48 : local_type_info(other.local_type_info),
50 catalog_id(other.catalog_id),
51 active_tag(other.active_tag),
52 tot_tags(other.tot_tags),
54 preferred_import_method(other.preferred_import_method)
56 if (other.properties) {
57 properties = IDP_CopyProperty(other.properties);
60 STRNCPY(catalog_simple_name, other.catalog_simple_name);
70AssetMetaData::AssetMetaData(AssetMetaData &&other)
71 : local_type_info(other.local_type_info),
72 properties(std::exchange(other.properties,
nullptr)),
73 catalog_id(other.catalog_id),
74 author(std::exchange(other.author,
nullptr)),
75 description(std::exchange(other.description,
nullptr)),
76 copyright(std::exchange(other.copyright,
nullptr)),
77 license(std::exchange(other.license,
nullptr)),
78 active_tag(other.active_tag),
79 tot_tags(other.tot_tags),
81 preferred_import_method(other.preferred_import_method)
84 STRNCPY(catalog_simple_name, other.catalog_simple_name);
86 other.tags.clear_no_delete();
89AssetMetaData::~AssetMetaData()
94 MEM_SAFE_DELETE(author);
95 MEM_SAFE_DELETE(description);
96 MEM_SAFE_DELETE(copyright);
97 MEM_SAFE_DELETE(license);
98 tags.free_no_destruct();
103 AssetTag *tag = MEM_new<AssetTag>(__func__);
165 const bUUID catalog_id,
166 const char *catalog_simple_name)
#define IDP_BlendDataRead(reader, prop)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
ID and Library types, which are fundamental for SDNA.
Read Blender memory allocation and freeing.
constexpr StringRef trim() const
void copy_utf8_truncated(char *dst, int64_t dst_size) const
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BKE_asset_metadata_catalog_id_clear(AssetMetaData *asset_data)
char * STRNCPY(char(&dst)[N], const char *src)
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void BKE_asset_metadata_idprop_ensure(AssetMetaData *asset_data, IDProperty *prop)
void BKE_asset_metadata_write(BlendWriter *writer, AssetMetaData *asset_data)
AssetMetaData * BKE_asset_metadata_copy(const AssetMetaData *source)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
void BKE_asset_metadata_free(AssetMetaData **asset_data)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BKE_asset_metadata_catalog_id_set(AssetMetaData *asset_data, bUUID catalog_id, const char *catalog_simple_name)
PreviewImage * BKE_asset_metadata_preview_get_from_id(const AssetMetaData *asset_data, const ID *owner_id)
void BKE_asset_metadata_tag_remove(AssetMetaData *asset_data, AssetTag *tag)
AssetTag * BKE_asset_metadata_tag_add(AssetMetaData *asset_data, const char *name) ATTR_NONNULL(1
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
IDProperty * BKE_asset_metadata_idprop_find(const AssetMetaData *asset_data, const char *name) ATTR_WARN_UNUSED_RESULT
void BKE_asset_library_reference_init_default(AssetLibraryReference *library_ref)
static AssetTag * asset_metadata_tag_add(AssetMetaData *asset_data, const char *const name)
PreviewImage * BKE_previewimg_id_get(const ID *id)
AssetTag AssetTagEnsureResult BKE_asset_metadata_tag_ensure(AssetMetaData *asset_data, const char *name)
AssetMetaData * BKE_asset_metadata_create()
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BKE_asset_metadata_read(BlendDataReader *reader, AssetMetaData *asset_data)
void IDP_FreeProperty(IDProperty *prop)
char * BLI_strdup_null(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
User defined tag. Currently only used by assets, could be used more often at some point....
void write_string(const char *data)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
Universally Unique Identifier according to RFC4122.