diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-12 17:15:58 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-12 17:48:24 +0300 |
commit | 07c8b829b51f1d59a214b229251902792735b92a (patch) | |
tree | da26d761501193c689838dc4c4cfff434a55bd9f /source/blender/editors/space_outliner/outliner_collections.c | |
parent | d5576d3b0fcbc3791abb9ab53ef7677775780ed7 (diff) |
Fix (unreported) Outliner's New Collection adding local collection to linked IDs.
Similar issue to the one about Duplicate operation...
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_collections.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_collections.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index f7084399268..04104aa0e4c 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -195,10 +195,15 @@ static int collection_new_exec(bContext *C, wmOperator *op) } } - if (data.collection == NULL) { + if (data.collection == NULL || ID_IS_LINKED(data.collection)) { data.collection = BKE_collection_master(scene); } + if (ID_IS_LINKED(scene)) { + BKE_report(op->reports, RPT_ERROR, "Can't add a new collection to linked scene/collection"); + return OPERATOR_CANCELLED; + } + BKE_collection_add( bmain, data.collection, |