fix [#27616] Appending an object from a file brings all existing group links to scene
authorCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jun 2011 04:28:53 +0000 (04:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jun 2011 04:28:53 +0000 (04:28 +0000)
When appending from a blend file which had an object already linked, _but_ was not in any scenes.
- the linked object would be instanced.

source/blender/blenloader/intern/readfile.c

index 49579432de2b0d99641be884e1d66251b0eaa6f6..1dc02c4b8661e448980913af195ca0a6940a5556 100644 (file)
@@ -12742,8 +12742,14 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const
                                        /* when appending, make sure any indirectly loaded objects
                                         * get a base else they cant be accessed at all [#27437] */
                                        if(ob->id.us==1 && is_link==FALSE && ob->id.lib==lib) {
-                                               if(object_in_any_scene(mainvar, ob)==0) {
-                                                       do_it= 1;
+
+                                               /* we may be appending from a scene where we already
+                                                *  have a linked object which is not in any scene [#27616] */
+                                               if((ob->id.flag & LIB_PRE_EXISTING)==0) {
+
+                                                       if(object_in_any_scene(mainvar, ob)==0) {
+                                                               do_it= 1;
+                                                       }
                                                }
                                        }
                                }