Commit: 7a462c3e3534f9bb08a87a8f494b11d3d108734b
Author: Lukas Tönne
Date:   Mon Feb 23 14:03:46 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB7a462c3e3534f9bb08a87a8f494b11d3d108734b

Link main CacheLibrary pointers in readfile.

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

M       source/blender/blenloader/intern/readfile.c
M       source/blender/blenloader/intern/writefile.c

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

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 58417e4..b0d951a 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1937,16 +1937,22 @@ static void direct_link_script(FileData *UNUSED(fd), 
Script *script)
 
 /* ************ READ CacheLibrary *************** */
 
-static void lib_link_cache_library(FileData *UNUSED(fd), Main *main)
+static void lib_link_cache_library(FileData *fd, Main *main)
 {
        CacheLibrary *cachelib;
        for (cachelib = main->cache_library.first; cachelib; cachelib = 
cachelib->id.next) {
-               cachelib->id.us = 1;
+               if (cachelib->id.flag & LIB_NEED_LINK) {
+                       cachelib->id.flag -= LIB_NEED_LINK;
+                       
+                       cachelib->group = newlibadr_us(fd, cachelib->id.lib, 
cachelib->group);
+               }
        }
 }
 
-static void direct_link_cache_library(FileData *UNUSED(fd), CacheLibrary 
*UNUSED(cachelib))
+static void direct_link_cache_library(FileData *fd, CacheLibrary *cachelib)
 {
+       link_list(fd, &cachelib->items);
+       cachelib->items_hash = NULL;
 }
 
 
diff --git a/source/blender/blenloader/intern/writefile.c 
b/source/blender/blenloader/intern/writefile.c
index a2dab26..af3abef 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3475,12 +3475,17 @@ static void write_linestyles(WriteData *wd, ListBase 
*idbase)
 static void write_cachelibraries(WriteData *wd, ListBase *idbase)
 {
        CacheLibrary *cachelib;
+       CacheItem *item;
 
        for (cachelib = idbase->first; cachelib; cachelib = cachelib->id.next) {
                if (cachelib->id.us > 0 || wd->current) {
                        writestruct(wd, ID_CL, "CacheLibrary", 1, cachelib);
                        if (cachelib->id.properties)
                                IDP_WriteProperty(cachelib->id.properties, wd);
+                       
+                       for (item = cachelib->items.first; item; item = 
item->next) {
+                               writestruct(wd, DATA, "CacheItem", 1, item);
+                       }
                }
        }
 }

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

Reply via email to