diff options
author | Julian Eisel <julian@blender.org> | 2021-10-25 14:48:48 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-25 14:51:14 +0300 |
commit | 4100a79219e7f7c474046806db3e156be34a1011 (patch) | |
tree | 2cae61fb3d31406299df7156087c2ad0caa20e8e /source/blender/blenkernel | |
parent | e7bea3fb6ed00f5eb9e332d1d5162097e865a1c0 (diff) |
Assets: Add Author field to asset metadata
This is information you'd typically want to be visible in the UI. It's optional
of course, so if not relevant, it can just remain unset.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/asset.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/asset.cc b/source/blender/blenkernel/intern/asset.cc index ae9ded3c754..dfe568729db 100644 --- a/source/blender/blenkernel/intern/asset.cc +++ b/source/blender/blenkernel/intern/asset.cc @@ -53,6 +53,7 @@ void BKE_asset_metadata_free(AssetMetaData **asset_data) if ((*asset_data)->properties) { IDP_FreeProperty((*asset_data)->properties); } + MEM_SAFE_FREE((*asset_data)->author); MEM_SAFE_FREE((*asset_data)->description); BLI_freelistN(&(*asset_data)->tags); @@ -158,6 +159,9 @@ void BKE_asset_metadata_write(BlendWriter *writer, AssetMetaData *asset_data) IDP_BlendWrite(writer, asset_data->properties); } + if (asset_data->author) { + BLO_write_string(writer, asset_data->author); + } if (asset_data->description) { BLO_write_string(writer, asset_data->description); } @@ -175,6 +179,7 @@ void BKE_asset_metadata_read(BlendDataReader *reader, AssetMetaData *asset_data) IDP_BlendDataRead(reader, &asset_data->properties); } + BLO_read_data_address(reader, &asset_data->author); BLO_read_data_address(reader, &asset_data->description); BLO_read_list(reader, &asset_data->tags); BLI_assert(BLI_listbase_count(&asset_data->tags) == asset_data->tot_tags); |