diff options
author | Bastien Montagne <bastien@blender.org> | 2021-08-04 12:40:20 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-08-04 12:42:13 +0300 |
commit | 051141acdecfd11f82cbe37bac368c2882dd4f92 (patch) | |
tree | 2e830c3d3f29583ac9328c7c6e4780e923cd8798 /source/blender/editors/space_outliner | |
parent | d9a530c55e869376aa2d0e9175a659d965d38d2a (diff) |
Outliner/LibOverrides: Fix logic of checks for drag'n'drop of Collections.
Previous check was too blunt, preventing e.g. re-organization of
collection overrides inside a local parent collection, which is
perfectly valid operation.
Reported by @hjalti from the studio, thanks!
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_dragdrop.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index 11ad3abcd54..a82f516b125 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -1104,10 +1104,6 @@ static bool collection_drop_init(bContext *C, if (ID_IS_LINKED(to_collection)) { return false; } - /* Currently this should not be allowed (might be supported in the future though...). */ - if (ID_IS_OVERRIDE_LIBRARY(to_collection)) { - return false; - } /* Get drag datablocks. */ if (drag->type != WM_DRAG_ID) { @@ -1131,6 +1127,11 @@ static bool collection_drop_init(bContext *C, from_collection = NULL; } + /* Currently this should not be allowed, cannot edit items in an override of a Collection. */ + if (from_collection != NULL && ID_IS_OVERRIDE_LIBRARY(from_collection)) { + return false; + } + /* Get collections. */ if (GS(id->name) == ID_GR) { if (id == &to_collection->id) { @@ -1141,6 +1142,12 @@ static bool collection_drop_init(bContext *C, insert_type = TE_INSERT_INTO; } + /* Currently this should not be allowed, cannot edit items in an override of a Collection. */ + if (ID_IS_OVERRIDE_LIBRARY(to_collection) && + !ELEM(insert_type, TE_INSERT_AFTER, TE_INSERT_BEFORE)) { + return false; + } + data->from = from_collection; data->to = to_collection; data->te = te; |