Bug fix: particle dynamics were being calculated if point cache was only half baked...
authorJanne Karhu <jhkarh@gmail.com>
Tue, 18 Jan 2011 09:25:37 +0000 (09:25 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Tue, 18 Jan 2011 09:25:37 +0000 (09:25 +0000)
* When a simulation is baked no dynamics calculations should happen anymore (even outside of baked frame range) since these can be very time consuming and baked simulations are supposed to be fast!

source/blender/blenkernel/intern/particle_system.c

index 06056e0ecc9e1c41399b79f6cbebc0222aa8ee74..6ec08e7660654e1e328282c8e1529b4d5be3d88b 100644 (file)
@@ -3854,14 +3854,15 @@ static void system_step(ParticleSimulationData *sim, float cfra)
 
                        return;
                }
+               /* Cache is supposed to be baked, but no data was found so bail out */
+               else if(cache->flag & PTCACHE_BAKED) {
+                       psys_reset(psys, PSYS_RESET_CACHE_MISS);
+                       return;
+               }
                else if(cache_result == PTCACHE_READ_OLD) {
                        psys->cfra = (float)cache->simframe;
                        cached_step(sim, psys->cfra);
                }
-               else if(cfra != startframe && ( /*sim->ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED))) { /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
-                       psys_reset(psys, PSYS_RESET_CACHE_MISS);
-                       return;
-               }
 
                /* if on second frame, write cache for first frame */
                if(psys->cfra == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact==0))