Bug fix: pre 2.5 particles that were using old memory caching didn't load properly
authorJanne Karhu <jhkarh@gmail.com>
Sat, 22 Jan 2011 21:13:29 +0000 (21:13 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Sat, 22 Jan 2011 21:13:29 +0000 (21:13 +0000)
* Now the old cache is just freed so that new calculations can be done.
* The particle dynamics regression test files should display correctly now.

source/blender/blenloader/intern/readfile.c

index e1d6c9fc48b2745862f53db05c76b95160fe3a46..6fa70b0a9c253df1fbd69a06ba82b2858814ef16 100644 (file)
@@ -8867,9 +8867,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                ob->soft->pointcache= BKE_ptcache_add(&ob->soft->ptcaches);
 
                        for(psys=ob->particlesystem.first; psys; psys=psys->next) {
-                               //if(psys->soft && !psys->soft->pointcache)
-                               //      psys->soft->pointcache= BKE_ptcache_add(&psys->soft->ptcaches);
-                               if(!psys->pointcache)
+                               if(psys->pointcache) {
+                                       if(psys->pointcache->flag & PTCACHE_BAKED && (psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) {
+                                               printf("Old memory cache isn't supported for particles, so re-bake the simulation!\n");
+                                               psys->pointcache->flag &= ~PTCACHE_BAKED;
+                                       }
+                               }
+                               else
                                        psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
                        }