Blender Git Commit Log

Git Commits -> Revision e81fca1

Revision e81fca1 by Julian Eisel (master)
February 16, 2021, 14:34 (GMT)
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.

Commit Details:

Full Hash: e81fca1ed38ea447a1023dae3841f8980def28e4
Parent Commit: 500bc99
Lines Changed: +121, -49

15 Modified Paths:

/source/blender/editors/screen/screen_ops.c (+2, -2) (Diff)
/source/blender/editors/space_clip/space_clip.c (+1, -1) (Diff)
/source/blender/editors/space_console/space_console.c (+2, -2) (Diff)
/source/blender/editors/space_file/space_file.c (+1, -1) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/space_node/node_add.c (+0, -12) (Diff)
/source/blender/editors/space_node/space_node.c (+15, -7) (Diff)
/source/blender/editors/space_outliner/outliner_dragdrop.c (+6, -6) (Diff)
/source/blender/editors/space_sequencer/space_sequencer.c (+3, -3) (Diff)
/source/blender/editors/space_text/space_text.c (+2, -2) (Diff)
/source/blender/editors/space_view3d/space_view3d.c (+29, -9) (Diff)
/source/blender/windowmanager/intern/wm_dragdrop.c (+40, -1) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+7, -1) (Diff)
/source/blender/windowmanager/WM_api.h (+6, -1) (Diff)
/source/blender/windowmanager/WM_types.h (+6, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021