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-10-04 00:58:20 +0300
committerJulian Eisel <julian@blender.org>2021-10-04 00:58:20 +0300
commitc4dca6522812670ab9782e4f90553c5054109f3d (patch)
tree24dc1e2c0eb55985e8e6543b131989da1ca4125e /source/blender/windowmanager/WM_api.h
parent3b1a2430391a6c1e0ea2744cfce2cf0749c72c85 (diff)
Asset Browser: Support dragging assets into catalogs
With this it is possible to select any number of assets in the Asset Browser and drag them into catalogs. The assets will be moved to that catalog then. However, this will only work in the "Current File" asset library, since that is the only library that allows changing assets, which is what's done here. While dragging assets over the tree row, a tooltip is shown explaining what's going to happen. In preparation to this, the new UI tree-view API was already extended with custom drop support, see 4ee2d9df428d. ---- Changes here to the `wmDrag` code were needed to support dragging multiple assets. Some of it is considered temporary because a) a proper #AssetHandle design should replace some ugly parts of this patch and b) the multi-item support in `wmDrag` isn't that great yet. The entire API will have to be written anyway (see D4071). Maniphest Tasks: T91573 Differential Revision: https://developer.blender.org/D12713 Reviewed by: Sybren Stüvel
Diffstat (limited to 'source/blender/windowmanager/WM_api.h')
-rw-r--r--source/blender/windowmanager/WM_api.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 577561017c4..ebb0f803acf 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -41,6 +41,8 @@ extern "C" {
#endif
struct ARegion;
+struct AssetHandle;
+struct AssetLibraryReference;
struct GHashIterator;
struct GPUViewport;
struct ID;
@@ -741,6 +743,9 @@ struct ID *WM_drag_get_local_ID(const struct wmDrag *drag, short idcode);
struct ID *WM_drag_get_local_ID_from_event(const struct wmEvent *event, short idcode);
bool WM_drag_is_ID_type(const struct wmDrag *drag, int idcode);
+wmDragAsset *WM_drag_create_asset_data(const struct AssetHandle *asset,
+ const char *path,
+ int import_type);
struct wmDragAsset *WM_drag_get_asset_data(const struct wmDrag *drag, int idcode);
struct ID *WM_drag_get_local_ID_or_import_from_asset(const struct wmDrag *drag, int idcode);
@@ -748,6 +753,12 @@ void WM_drag_free_imported_drag_ID(struct Main *bmain,
struct wmDrag *drag,
struct wmDropBox *drop);
+void WM_drag_add_asset_list_item(wmDrag *drag,
+ const struct bContext *C,
+ const struct AssetLibraryReference *asset_library_ref,
+ const struct AssetHandle *asset);
+const ListBase *WM_drag_asset_list_get(const wmDrag *drag);
+
const char *WM_drag_get_item_name(struct wmDrag *drag);
/* Set OpenGL viewport and scissor */