Commit: 83876d5275b381485803183462ffcd993798e3e5
Author: Kévin Dietrich
Date:   Tue Jun 14 16:57:56 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB83876d5275b381485803183462ffcd993798e3e5

Merge branch 'master' into alembic_basic_io

Conflicts:
        source/blender/blenloader/intern/writefile.c

===================================================================



===================================================================

diff --cc source/blender/blenloader/intern/writefile.c
index 81d25c7,327b7b5..fcc72f1
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -3629,17 -3574,65 +3575,76 @@@ static void write_linestyles(WriteData 
        }
  }
  
 +static void write_cachefiles(WriteData *wd, ListBase *idbase)
 +{
 +      CacheFile *cache_file;
 +
 +      for (cache_file = idbase->first; cache_file; cache_file = 
cache_file->id.next) {
 +              if (cache_file->id.us > 0 || wd->current) {
 +                      writestruct(wd, ID_CF, "CacheFile", 1, cache_file);
 +              }
 +      }
 +}
 +
+ /* Keep it last of write_foodata functions. */
+ static void write_libraries(WriteData *wd, Main *main)
+ {
+       ListBase *lbarray[MAX_LIBARRAY];
+       ID *id;
+       int a, tot;
+       bool found_one;
+ 
+       for (; main; main= main->next) {
+ 
+               a=tot= set_listbasepointers(main, lbarray);
+ 
+               /* test: is lib being used */
+               if (main->curlib && main->curlib->packedfile)
+                       found_one = true;
+               else {
+                       found_one = false;
+                       while (tot--) {
+                               for (id= lbarray[tot]->first; id; id= id->next) 
{
+                                       if (id->us > 0 && (id->tag & 
LIB_TAG_EXTERN)) {
+                                               found_one = true;
+                                               break;
+                                       }
+                               }
+                               if (found_one) break;
+                       }
+               }
+ 
+               /* to be able to restore quit.blend and temp saves, the packed 
blend has to be in undo buffers... */
+               /* XXX needs rethink, just like save UI in undo files now - 
would be nice to append things only for the]
+                * quit.blend and temp saves */
+               if (found_one) {
+                       writestruct(wd, ID_LI, "Library", 1, main->curlib);
+                       write_iddata(wd, &main->curlib->id);
+ 
+                       if (main->curlib->packedfile) {
+                               PackedFile *pf = main->curlib->packedfile;
+                               writestruct(wd, DATA, "PackedFile", 1, pf);
+                               writedata(wd, DATA, pf->size, pf->data);
+                               if (wd->current == NULL)
+                                       printf("write packed .blend: %s\n", 
main->curlib->name);
+                       }
+ 
+                       while (a--) {
+                               for (id= lbarray[a]->first; id; id= id->next) {
+                                       if (id->us > 0 && (id->tag & 
LIB_TAG_EXTERN)) {
+                                               if 
(!BKE_idcode_is_linkable(GS(id->name))) {
+                                                       printf("ERROR: write 
file: datablock '%s' from lib '%s' is not linkable "
+                                                              "but is flagged 
as directly linked", id->name, main->curlib->filepath);
+                                                       BLI_assert(0);
+                                               }
+                                               writestruct(wd, ID_ID, "ID", 1, 
id);
+                                       }
+                               }
+                       }
+               }
+       }
+ }
+ 
  /* context is usually defined by WM, two cases where no WM is available:
   * - for forward compatibility, curscreen has to be saved
   * - for undofile, curscene needs to be saved */

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

Reply via email to