diff options
author | Julian Eisel <julian@blender.org> | 2022-11-09 20:34:31 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-09 21:30:47 +0300 |
commit | 1efc94bb2f7b0321935ce6564b23d5d92ee41594 (patch) | |
tree | bf2d28a3b48f5a480dbd2c4091226f1783fd0778 /source/blender/editors/interface/interface_drag.cc | |
parent | 7395062480a6b6c623516eaad7e489451e16bcaf (diff) |
Asset System: New core type to represent assets (`AssetRepresenation`)
Introduces a new `AssetRepresentation` type, as a runtime only container
to hold asset information. It is supposed to become _the_ main way to
represent and refer to assets in the asset system, see T87235. It can
store things like the asset name, asset traits, preview and other asset
metadata.
Technical documentation:
https://wiki.blender.org/wiki/Source/Architecture/Asset_System/Back_End#Asset_Representation.
By introducing a proper asset representation type, we do an important
step away from the previous, non-optimal representation of assets as
files in the file browser backend, and towards the asset system as
backend. It should replace the temporary & hacky `AssetHandle` design in
the near future. Note that the loading of asset data still happens
through the file browser backend, check the linked to Wiki page for more
information on that.
As a side-effect, asset metadata isn't stored in file browser file
entries when browsing with link/append anymore. Don't think this was
ever used, but scripts may have accessed this. Can be brought back if
there's a need for it.
Diffstat (limited to 'source/blender/editors/interface/interface_drag.cc')
-rw-r--r-- | source/blender/editors/interface/interface_drag.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_drag.cc b/source/blender/editors/interface/interface_drag.cc index 4bf2dac4151..e959986d19e 100644 --- a/source/blender/editors/interface/interface_drag.cc +++ b/source/blender/editors/interface/interface_drag.cc @@ -27,15 +27,14 @@ void UI_but_drag_attach_image(uiBut *but, struct ImBuf *imb, const float scale) } void UI_but_drag_set_asset(uiBut *but, - const AssetHandle *asset, + const AssetHandle *asset_handle, const char *path, - struct AssetMetaData *metadata, int import_type, int icon, struct ImBuf *imb, float scale) { - wmDragAsset *asset_drag = WM_drag_create_asset_data(asset, metadata, path, import_type); + wmDragAsset *asset_drag = WM_drag_create_asset_data(asset_handle, path, import_type); /* FIXME: This is temporary evil solution to get scene/view-layer/etc in the copy callback of the * #wmDropBox. |