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-05 16:39:43 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-05 16:41:46 +0300
commit683e64247f060acbb8b9ba9178e7555dc57aa10b (patch)
treef00d956574843a42c9a4d6a2ee639517d943ef45 /source/blender/blenloader
parent6d110a03b7b309a78202a7136da9c4853a5670c8 (diff)
Fix T61796: Linking a collection with instances inside will place the instanced object in the scene.
Do not force to link indirectly linked collections into current scene, that is usually not desired. Note that user can always add this link manually if they want. All this 'implicit instantiation' post-linking process is rather hairy to get it correct, hope this time it's not breaking something else...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 572946cac48..82ef725ef37 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10899,7 +10899,8 @@ static void add_collections_to_scene(
ob->transflag |= OB_DUPLICOLLECTION;
copy_v3_v3(ob->loc, scene->cursor.location);
}
- else {
+ /* We do not want to force instantiation of indirectly linked collections... */
+ else if ((collection->id.tag & LIB_TAG_INDIRECT) == 0) {
bool do_add_collection = (collection->id.tag & LIB_TAG_DOIT) != 0;
if (!do_add_collection) {
/* We need to check that objects in that collections are already instantiated in a scene.
@@ -10911,6 +10912,7 @@ static void add_collections_to_scene(
Object *ob = coll_ob->ob;
if ((ob->id.tag & LIB_TAG_PRE_EXISTING) == 0 &&
(ob->id.tag & LIB_TAG_DOIT) == 0 &&
+ (ob->id.tag & LIB_TAG_INDIRECT) == 0 &&
(ob->id.lib == lib) &&
(object_in_any_scene(bmain, ob) == 0))
{