diff options
author | Julian Eisel <julian@blender.org> | 2021-02-16 17:24:22 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-02-16 17:34:32 +0300 |
commit | e81fca1ed38ea447a1023dae3841f8980def28e4 (patch) | |
tree | d0d07de23c839fa147850fdc728d512eb17a6141 /source/blender/editors/space_clip | |
parent | 500bc99da5dbcdf7c728833326fc29babaf529e0 (diff) |
Assets: Remove appended asset when dropping operation fails
When dropping an asset somewhere, it is appended and then a drop operation is
called to actually add it to the scene based on current context. If this drop
operation fails, the appended data-block is now still in the .blend. The user
may not notice and not expect this.
Instead idea is to rollback any changes done by dropping code if the operation
fails, namely removing the appended data-block again.
Adds a new `cancel()` callback which is called if the drop operator returns
`OPERATOR_CANCELLED` to drop-boxes and a generic function to deal with assets
on drop failure.
Also removes the `free_id_on_error` property of the `NODE_OT_add_group`
operator, which was used as ad-hoc solution to get this same behavior.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 2a7c64a83f7..e0a524a79c1 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -639,7 +639,7 @@ static void clip_dropboxes(void) { ListBase *lb = WM_dropboxmap_find("Clip", SPACE_CLIP, 0); - WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy); + WM_dropbox_add(lb, "CLIP_OT_open", clip_drop_poll, clip_drop_copy, NULL); } static void clip_refresh(const bContext *C, ScrArea *area) |