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 <bastien@blender.org>2020-10-13 14:05:19 +0300
committerBastien Montagne <bastien@blender.org>2020-10-13 14:08:41 +0300
commit3f78569c3e62ea3a184c7e0854e6e699c814cc72 (patch)
tree3d05b41f38dd1626523644a1a7867b92b368db29 /source/blender/blenkernel
parent666485f38ca5abe89db042635572bd2a06fb7896 (diff)
Fix (unreported) liboverride of an object hiding its dependencies.
When we override a whole collection, we want to add non-instantiated objects to a hidden sub-collection at the end of the process. However, this makes no sense when instantiating an object, if other dependencies objects get also overridden on the process, we should just add them to the same collection owning the root object.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/lib_override.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index a989a865994..e008058ae39 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -597,32 +597,30 @@ static void lib_override_library_create_post_process(
case ID_GR: {
default_instantiating_collection = BKE_collection_add(
bmain, (Collection *)id_root, "OVERRIDE_HIDDEN");
+ /* Hide the collection from viewport and render. */
+ default_instantiating_collection->flag |= COLLECTION_RESTRICT_VIEWPORT |
+ COLLECTION_RESTRICT_RENDER;
break;
}
case ID_OB: {
- /* Add the new container collection to one of the collections instantiating the
+ /* Add the other objects to one of the collections instantiating the
* root object, or scene's master collection if none found. */
Object *ob_root = (Object *)id_root;
LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
if (BKE_collection_has_object(collection, ob_root) &&
BKE_view_layer_has_collection(view_layer, collection) &&
!ID_IS_LINKED(collection) && !ID_IS_OVERRIDE_LIBRARY(collection)) {
- default_instantiating_collection = BKE_collection_add(
- bmain, collection, "OVERRIDE_HIDDEN");
+ default_instantiating_collection = collection;
}
}
if (default_instantiating_collection == NULL) {
- default_instantiating_collection = BKE_collection_add(
- bmain, scene->master_collection, "OVERRIDE_HIDDEN");
+ default_instantiating_collection = scene->master_collection;
}
break;
}
default:
BLI_assert(0);
}
- /* Hide the collection from viewport and render. */
- default_instantiating_collection->flag |= COLLECTION_RESTRICT_VIEWPORT |
- COLLECTION_RESTRICT_RENDER;
}
BKE_collection_object_add(bmain, default_instantiating_collection, ob_new);