Fix part of T55439: don't add indirectly linked objects to the scene on link.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 11 Jun 2018 19:51:21 +0000 (21:51 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 11 Jun 2018 19:51:21 +0000 (21:51 +0200)
source/blender/blenloader/intern/readfile.c

index 6aeb3e0..039af3c 100644 (file)
@@ -10002,13 +10002,15 @@ static void add_loose_objects_to_scene(
                if ((ob->id.tag & LIB_TAG_INDIRECT) && (ob->id.tag & LIB_TAG_PRE_EXISTING) == 0) {
                        bool do_it = false;
 
-                       if (ob->id.us == 0) {
-                               do_it = true;
-                       }
-                       else if (!is_link && (ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) {
-                               /* When appending, make sure any indirectly loaded objects get a base, else they cant be accessed at all
-                                * (see T27437). */
-                               do_it = true;
+                       if (!is_link) {
+                               if (ob->id.us == 0) {
+                                       do_it = true;
+                               }
+                               else if ((ob->id.lib == lib) && (object_in_any_scene(bmain, ob) == 0)) {
+                                       /* When appending, make sure any indirectly loaded objects get a base, else they cant be accessed at all
+                                        * (see T27437). */
+                                       do_it = true;
+                               }
                        }
 
                        if (do_it) {