Revision: 27880
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27880
Author:   campbellbarton
Date:     2010-03-30 21:53:30 +0200 (Tue, 30 Mar 2010)

Log Message:
-----------
appending a data that linked to another blend file would fail to save that link 
because it didnt tag it as directly linked.

Modified Paths:
--------------
    branches/render25/source/blender/blenkernel/intern/library.c
    branches/render25/source/blender/blenloader/intern/readfile.c

Modified: branches/render25/source/blender/blenkernel/intern/library.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/library.c        
2010-03-30 18:36:33 UTC (rev 27879)
+++ branches/render25/source/blender/blenkernel/intern/library.c        
2010-03-30 19:53:30 UTC (rev 27880)
@@ -1236,11 +1236,17 @@
 
 #define LIBTAG(a)      if(a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; 
a->id.flag |= LIB_EXTERN;}
 
-static void lib_indirect_test_id(ID *id)
+static void lib_indirect_test_id(ID *id, Library *lib)
 {
        
-       if(id->lib)
+       if(id->lib) {
+               /* datablocks that were indirectly related are now direct links
+                * without this, appending data that has a link to other data 
will fail to write */
+               if(lib && id->lib->parent == lib) {
+                       id_lib_extern(id);
+               }
                return;
+       }
        
        if(GS(id->name)==ID_OB) {               
                Object *ob= (Object *)id;
@@ -1336,7 +1342,7 @@
        a= set_listbasepointers(G.main, lbarray);
        while(a--) {
                for(id= lbarray[a]->first; id; id=id->next)
-                       lib_indirect_test_id(id);
+                       lib_indirect_test_id(id, lib);
        }
 }
 

Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c       
2010-03-30 18:36:33 UTC (rev 27879)
+++ branches/render25/source/blender/blenloader/intern/readfile.c       
2010-03-30 19:53:30 UTC (rev 27880)
@@ -12172,8 +12172,8 @@
                                if(fd==NULL) {
 
                                        /* printf and reports for now... its 
important users know this */
-                                       printf("read library: %s\n", 
mainptr->curlib->name);
-                                       BKE_reportf(basefd->reports, RPT_INFO, 
"read library: '%s'\n", mainptr->curlib->name);
+                                       printf("read library: '%s', '%s'\n", 
mainptr->curlib->filename, mainptr->curlib->name);
+                                       BKE_reportf(basefd->reports, RPT_INFO, 
"read library:  '%s', '%s'\n", mainptr->curlib->filename, 
mainptr->curlib->name);
 
                                        fd= 
blo_openblenderfile(mainptr->curlib->filename, basefd->reports);
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to