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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-12 17:47:07 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-12 17:48:24 +0300
commit4b5570533dff28100ce569dd08025505d678b788 (patch)
tree07b6f8f9ea66996a1aa82a03a6afd331e6e7ba3a /source/blender/editors/space_outliner
parent9778b0a5bc24b82b9ea32a7a28c564eec58ebc67 (diff)
Fix (unreported) Outliner could add (link...) a collection to a linked scene/collection.
Think that's the last case... At least for now.
Diffstat (limited to 'source/blender/editors/space_outliner')
-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). */