Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-06-28 07:26:10 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-28 07:26:10 +0400
commit500507ddb1efdf9f69d8a61e3d03a855ee017902 (patch)
tree2a243c975661b12ff7e66289b714c71b7234f13e /source/blender/blenloader
parent61e30f0f001285dcbf0c7ec8ba44151544bfc8d9 (diff)
parent7271f86be58d0705dd5abc01ac508e1775951fa8 (diff)
NLA SoC: Merge from 2.5 - 21179 to 21209
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c13
-rw-r--r--source/blender/blenloader/intern/writefile.c5
2 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b9cbb863022..6df907fe132 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9076,6 +9076,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Tex *tx;
ParticleSettings *part;
Object *ob;
+ PTCacheID *pid;
+ ListBase pidlist;
for(screen= main->screen.first; screen; screen= screen->id.next) {
do_versions_windowmanager_2_50(screen);
@@ -9136,14 +9138,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
/* set old pointcaches to have disk cache flag */
for(ob = main->object.first; ob; ob= ob->id.next) {
- ParticleSystem *psys = ob->particlesystem.first;
- for(; psys; psys=psys->next) {
- if(psys->pointcache)
- psys->pointcache->flag |= PTCACHE_DISK_CACHE;
- }
+ BKE_ptcache_ids_from_object(&pidlist, ob);
+
+ for(pid=pidlist.first; pid; pid=pid->next)
+ pid->cache->flag |= PTCACHE_DISK_CACHE;
- /* TODO: softbody & cloth caches */
+ BLI_freelistN(&pidlist);
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index e6ca289e610..80d1d78257b 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -552,6 +552,7 @@ static void write_userdef(WriteData *wd)
/* TODO: replace *cache with *cachelist once it's coded */
#define PTCACHE_WRITE_PSYS 0
+#define PTCACHE_WRITE_CLOTH 1
static void write_pointcaches(WriteData *wd, PointCache *cache, int type)
{
writestruct(wd, DATA, "PointCache", 1, cache);
@@ -563,6 +564,8 @@ static void write_pointcaches(WriteData *wd, PointCache *cache, int type)
writestruct(wd, DATA, "PTCacheMem", 1, pm);
if(type==PTCACHE_WRITE_PSYS)
writestruct(wd, DATA, "ParticleKey", pm->totpoint, pm->data);
+ else if(type==PTCACHE_WRITE_CLOTH)
+ writedata(wd, DATA, 9 * sizeof(float) * pm->totpoint, pm->data);
}
}
}
@@ -1058,7 +1061,7 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo)
writestruct(wd, DATA, "ClothSimSettings", 1, clmd->sim_parms);
writestruct(wd, DATA, "ClothCollSettings", 1, clmd->coll_parms);
- writestruct(wd, DATA, "PointCache", 1, clmd->point_cache);
+ write_pointcaches(wd, clmd->point_cache, PTCACHE_WRITE_CLOTH);
}
else if(md->type==eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd = (FluidsimModifierData*) md;