From 4b5570533dff28100ce569dd08025505d678b788 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 12 Mar 2019 15:47:07 +0100 Subject: Fix (unreported) Outliner could add (link...) a collection to a linked scene/collection. Think that's the last case... At least for now. --- source/blender/editors/space_outliner/outliner_collections.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index b79f93781d2..30eaefe6149 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -562,7 +562,7 @@ void OUTLINER_OT_collection_duplicate(wmOperatorType *ot) /**************************** Link Collection ******************************/ -static int collection_link_exec(bContext *C, wmOperator *UNUSED(op)) +static int collection_link_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -570,6 +570,13 @@ static int collection_link_exec(bContext *C, wmOperator *UNUSED(op)) SpaceOutliner *soops = CTX_wm_space_outliner(C); struct CollectionEditData data = {.scene = scene, .soops = soops,}; + if (ID_IS_LINKED(active_collection) || + ((active_collection->flag & COLLECTION_IS_MASTER) && ID_IS_LINKED(scene))) + { + BKE_report(op->reports, RPT_ERROR, "Cannot add a colection to a linked collection/scene"); + return OPERATOR_CANCELLED; + } + data.collections_to_edit = BLI_gset_ptr_new(__func__); /* We first walk over and find the Collections we actually want to link (ignoring duplicates). */ -- cgit v1.2.3