From 37acf4722d1279aad5ad16ccbcaebfe4252df781 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 18 Aug 2018 10:05:54 +0200 Subject: [PATCH] Static Override: link newly overridden collection to scene. This avoids getting all overridden objects from said collection instantiated in master collection, totally untidy! Note that there is still an issue when 'active' object (i.e. the armature usually) is in hidden sub-collection, since you have to make that whole hidden collection visible again to see it. We'll need to support moving objects into overridden collections am afraid, arg. :( --- source/blender/editors/object/object_relations.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index bce57f6d55d..7eca34c505f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2317,6 +2317,8 @@ static int make_override_static_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Collection *new_collection = (Collection *)collection->id.newid; + + BKE_collection_child_add(bmain, scene->master_collection, new_collection); FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(new_collection, new_ob) { if (new_ob != NULL && new_ob->id.override_static != NULL) {