Fix #33353: Smoke color problems with adaptive domain
authorMiika Hamalainen <blender@miikah.org>
Fri, 30 Nov 2012 11:01:14 +0000 (11:01 +0000)
committerMiika Hamalainen <blender@miikah.org>
Fri, 30 Nov 2012 11:01:14 +0000 (11:01 +0000)
High resolution cache didn't always read all written data fields which caused colors to get messed up.

source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/smoke.c

index 3f2eb32f61c6a42ff5ea771f7d47e4ca59f614aa..965a1e2b4a61d4f631484cb50065a37e02222071 100644 (file)
@@ -686,7 +686,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 
        /* reallocate fluid if needed*/
        if (reallocate) {
-               sds->active_fields = active_fields;
+               sds->active_fields = active_fields | cache_fields;
                smoke_reallocate_fluid(sds, ch_dx, ch_res, 1);
                sds->dx = ch_dx;
                VECCOPY(sds->res, ch_res);
@@ -755,6 +755,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
                        if (cache_fields & SM_ACTIVE_FIRE) {
                                ptcache_file_compressed_read(pf, (unsigned char *)flame, out_len_big);
                                ptcache_file_compressed_read(pf, (unsigned char *)fuel, out_len_big);
+                               ptcache_file_compressed_read(pf, (unsigned char *)react, out_len_big);
                        }
                        if (cache_fields & SM_ACTIVE_COLORS) {
                                ptcache_file_compressed_read(pf, (unsigned char *)r, out_len_big);
index d96bece2b116c2e0a9a890b9835bb665e7cfe184..53dfbdcfb858ec5133b944460e8cee1ea9429c54 100644 (file)
@@ -165,7 +165,7 @@ void flame_get_spectrum(unsigned char *UNUSED(spec), int UNUSED(width), float UN
 void smoke_reallocate_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old)
 {
        int use_heat = (sds->active_fields & SM_ACTIVE_HEAT);
-       int use_fire = (sds->active_fields & (SM_ACTIVE_HEAT | SM_ACTIVE_FIRE));
+       int use_fire = (sds->active_fields & SM_ACTIVE_FIRE);
        int use_colors = (sds->active_fields & SM_ACTIVE_COLORS);
 
        if (free_old && sds->fluid)