Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c9
1 files changed, 8 insertions, 1 deletions
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). */