Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-07-20 21:58:15 +0300
committerJulian Eisel <julian@blender.org>2021-07-20 22:30:03 +0300
commit5a1b1c0ed2e6d085c93b8afd699407f92cc2d07d (patch)
treedc52de62700959ffedbc786e79ed39f6fe36f90b /source/blender/editors/asset/asset_edit.cc
parent207df439e1ad50b3af691f91710b886d0e997993 (diff)
Cleanup: Getters for asset-handle data
While the asset-handle design is supposed to be temporary (see 35affaa971cf), I prefer keeping the fact that it's nothing but a file entry pointer an implementation detail that is abstracted away. So this introduces getters for the file data we typically access for asset-handles.
Diffstat (limited to 'source/blender/editors/asset/asset_edit.cc')
-rw-r--r--source/blender/editors/asset/asset_edit.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/asset/asset_edit.cc b/source/blender/editors/asset/asset_edit.cc
index f4860737193..c44960f3b5a 100644
--- a/source/blender/editors/asset/asset_edit.cc
+++ b/source/blender/editors/asset/asset_edit.cc
@@ -139,6 +139,26 @@ const char *ED_asset_handle_get_name(const AssetHandle *asset)
return asset->file_data->name;
}
+AssetMetaData *ED_asset_handle_get_metadata(const AssetHandle *asset)
+{
+ return asset->file_data->asset_data;
+}
+
+ID *ED_asset_handle_get_local_id(const AssetHandle *asset)
+{
+ return asset->file_data->id;
+}
+
+ID_Type ED_asset_handle_get_id_type(const AssetHandle *asset)
+{
+ return static_cast<ID_Type>(asset->file_data->blentype);
+}
+
+int ED_asset_handle_get_preview_icon_id(const AssetHandle *asset)
+{
+ return asset->file_data->preview_icon_id;
+}
+
void ED_asset_handle_get_full_library_path(const bContext *C,
const AssetLibraryReference *asset_library,
const AssetHandle *asset,