Blender  V2.93
BKE_asset.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "BLI_utildefines.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct BlendDataReader;
30 struct BlendWriter;
31 struct ID;
32 struct PreviewImage;
33 
35 void BKE_asset_metadata_free(struct AssetMetaData **asset_data);
36 
38  struct AssetTag *tag;
39  /* Set to false if a tag of this name was already present. */
40  bool is_new;
41 };
42 
43 struct AssetTag *BKE_asset_metadata_tag_add(struct AssetMetaData *asset_data, const char *name);
45  const char *name);
46 void BKE_asset_metadata_tag_remove(struct AssetMetaData *asset_data, struct AssetTag *tag);
47 
49  const struct ID *owner_id);
50 
51 void BKE_asset_metadata_write(struct BlendWriter *writer, struct AssetMetaData *asset_data);
52 void BKE_asset_metadata_read(struct BlendDataReader *reader, struct AssetMetaData *asset_data);
53 
54 #ifdef __cplusplus
55 }
56 #endif
void BKE_asset_metadata_tag_remove(struct AssetMetaData *asset_data, struct AssetTag *tag)
Definition: asset.cc:104
struct AssetMetaData * BKE_asset_metadata_create(void)
Definition: asset.cc:40
void BKE_asset_metadata_write(struct BlendWriter *writer, struct AssetMetaData *asset_data)
Definition: asset.cc:123
void BKE_asset_metadata_free(struct AssetMetaData **asset_data)
Definition: asset.cc:47
struct PreviewImage * BKE_asset_metadata_preview_get_from_id(const struct AssetMetaData *asset_data, const struct ID *owner_id)
void BKE_asset_metadata_read(struct BlendDataReader *reader, struct AssetMetaData *asset_data)
Definition: asset.cc:139
struct AssetTagEnsureResult BKE_asset_metadata_tag_ensure(struct AssetMetaData *asset_data, const char *name)
Definition: asset.cc:81
struct AssetTag * BKE_asset_metadata_tag_add(struct AssetMetaData *asset_data, const char *name)
Definition: asset.cc:71
The meta-data of an asset. By creating and giving this for a data-block (ID.asset_data),...
struct AssetTag * tag
Definition: BKE_asset.h:38
User defined tag. Currently only used by assets, could be used more often at some point....
char name[64]
Definition: DNA_ID.h:273