[Bf-blender-cvs] [9061ac3] alembic_pointcache: Pass ListBase mem_cache as an explicit argument to the point cache conversion methods. This will no longer be stored in the PointCache DNA struct (all caches are disk based now).

Lukas Tönne noreply at git.blender.org
Thu Oct 16 16:53:32 CEST 2014


Commit: 9061ac3d99eb5b796f55f48b466ddda533934e08
Author: Lukas Tönne
Date:   Wed Nov 27 14:00:41 2013 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB9061ac3d99eb5b796f55f48b466ddda533934e08

Pass ListBase mem_cache as an explicit argument to the point cache
conversion methods. This will no longer be stored in the PointCache
DNA struct (all caches are disk based now).

ParticleSystem stores this as a separate list now, so it can keep using
it in edit mode and for trails drawing.

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

M	source/blender/blenkernel/BKE_pointcache.h
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/makesdna/DNA_particle_types.h

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

diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 5418660..a279e2d 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -318,11 +318,10 @@ void BKE_ptcache_quick_cache_all(struct Main *bmain, struct Scene *scene);
 void BKE_ptcache_bake(struct PTCacheBaker *baker);
 
 /* Convert disk cache to memory cache. */
-void BKE_ptcache_disk_to_mem(struct PTCacheID *pid);
+void BKE_ptcache_to_mem(struct PTCacheID *pid, struct ListBase *mem_cache);
 
 /* Convert memory cache to disk cache. */
-void BKE_ptcache_mem_to_disk(struct PTCacheID *pid);
-
+void BKE_ptcache_from_mem(struct PTCacheID *pid, struct ListBase *mem_cache);
 
 /* Rename all disk cache files with a new name. Doesn't touch the actual content of the files. */
 void BKE_ptcache_disk_cache_rename(struct PTCacheID *pid, const char *name_src, const char *name_dst);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 6b42c5d..d295290 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2176,7 +2176,7 @@ void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
 		PTCacheID pid;
 		BKE_ptcache_id_from_particles(&pid, ob, psys);
 		cache->flag &= ~PTCACHE_DISK_CACHE;
-		BKE_ptcache_disk_to_mem(&pid);
+		BKE_ptcache_to_mem(&pid, &psys->mem_pointcache);
 		cache->flag |= PTCACHE_DISK_CACHE;
 	}
 }
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 4b441e0..29ffcef 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3216,7 +3216,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
 	/* TODO: call redraw all windows somehow */
 }
 /* Helpers */
-void BKE_ptcache_disk_to_mem(PTCacheID *pid)
+void BKE_ptcache_to_mem(PTCacheID *pid, ListBase *mem_cache)
 {
 	PointCache *cache = pid->cache;
 	PTCacheMem *pm = NULL;
@@ -3236,13 +3236,13 @@ void BKE_ptcache_disk_to_mem(PTCacheID *pid)
 		pm = ptcache_disk_frame_to_mem(pid, cfra);
 
 		if (pm)
-			BLI_addtail(&pid->cache->mem_cache, pm);
+			BLI_addtail(mem_cache, pm);
 	}
 }
-void BKE_ptcache_mem_to_disk(PTCacheID *pid)
+void BKE_ptcache_from_mem(PTCacheID *pid, ListBase *mem_cache)
 {
 	PointCache *cache = pid->cache;
-	PTCacheMem *pm = cache->mem_cache.first;
+	PTCacheMem *pm = mem_cache->first;
 	int baked = cache->flag & PTCACHE_BAKED;
 
 	/* Remove possible bake flag to allow clear */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index b9279b6..bd9d0b9 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -298,6 +298,7 @@ typedef struct ParticleSystem {
 	/* point cache */
 	struct PointCache *pointcache;
 	struct ListBase ptcaches DNA_DEPRECATED;
+	struct ListBase mem_pointcache;
 
 	struct ListBase *effectors;




More information about the Bf-blender-cvs mailing list