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. :(
This commit is contained in:
Bastien Montagne
2018-08-18 10:05:54 +02:00
parent a069d3dc8c
commit 37acf4722d

View File

@@ -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) {