Blender Git Commit Log

Git Commits -> Revision b5d778a

Revision b5d778a by Julian Eisel (master)
December 15, 2020, 16:03 (GMT)
Asset System: Support dragging assets and appending on drop

For the Asset Browser, it needs to be possible to drag assets into various
editors, which may not come from the current .blend file. In other words, the
dragging needs to work with just the asset metadata, without direct access to
the data-block itself.

Idea is simple: When dragging an asset, store the source file-path and
data-block name and when dropping, append the data-block. It uses existing drop
operators, but the function to get the dropped data-block is replaced with one
that returns the local data-block, or, in case of an external asset, appends
the data-block first.

The drop operators need to be adjusted to use this new function that respects
assets. With this patch it only works for dragging assets into the 3D view.

Note that I expect this to be a short-lived change. A refactor like D4071 is
needed to make the drag & drop system more future proof for assets and other
use cases.

Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.

Differential Revision: https://developer.blender.org/D9721

Reviewed by: Bastien Montagne, Brecht Van Lommel

Commit Details:

Full Hash: b5d778a7d4072bfb091198a2094890157a6d017b
Parent Commit: 9363132
Lines Changed: +181, -58

11 Modified Paths:

/source/blender/editors/include/UI_interface.h (+7, -0) (Diff)
/source/blender/editors/interface/interface.c (+31, -6) (Diff)
/source/blender/editors/interface/interface_handlers.c (+4, -1) (Diff)
/source/blender/editors/space_console/space_console.c (+2, -2) (Diff)
/source/blender/editors/space_node/space_node.c (+4, -4) (Diff)
/source/blender/editors/space_outliner/outliner_dragdrop.c (+9, -9) (Diff)
/source/blender/editors/space_text/space_text.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/space_view3d.c (+18, -8) (Diff)
/source/blender/windowmanager/intern/wm_dragdrop.c (+84, -18) (Diff)
/source/blender/windowmanager/WM_api.h (+7, -3) (Diff)
/source/blender/windowmanager/WM_types.h (+14, -6) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021