Smoke:
authorDaniel Genrich <daniel.genrich@gmx.net>
Thu, 1 Apr 2010 14:44:31 +0000 (14:44 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Thu, 1 Apr 2010 14:44:31 +0000 (14:44 +0000)
* Bugfix for missing high res calculation when low res cache was already there
* Bugfix for loading file with smoke but tfor the first "round" of alt-a nothing happened. Now the smoke gets calculated on file load, too.

source/blender/blenkernel/intern/smoke.c

index 00e810637601e5925bcbed9fd28198de42a22032..aa513ab0fb77d91a65d87ab4219f175024f6faf6 100644 (file)
@@ -1156,10 +1156,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
 
                framenr = scene->r.cfra;
 
-               // printf("time: %d\n", scene->r.cfra);
-
-               if(framenr == smd->time)
-                       return;
+               printf("time: %d\n", scene->r.cfra);
 
                cache = sds->point_cache[0];
                BKE_ptcache_id_from_smoke(&pid, ob, smd);
@@ -1206,11 +1203,23 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
                                if(cache_result_wt == PTCACHE_READ_EXACT) 
                                {
                                        BKE_ptcache_validate(cache_wt, framenr);
+
+                                       return;
+                               }
+                               else
+                               {
+                                       ; /* don't return in the case we only got low res cache but no high res cache */
+                                       /* we still need to calculate the high res cache */
                                }
                        }
-                       return;
+                       else
+                               return;
                }
 
+               /* only calculate something when we advanced a frame */
+               if(framenr == smd->time)
+                       return;
+
                tstart();
 
                smoke_calc_domain(scene, ob, smd);