diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-08-04 19:09:03 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-08-04 19:09:17 +0300 |
commit | df28a68e7009da6a1de4597ecb579236e542e170 (patch) | |
tree | b328b6cd0fe505665fc0381f22b75a46920bde22 | |
parent | f2ac432467e9ba8f7d1092ae4777ba1640104abd (diff) |
Fix T72192: Mantaflow does not render flame when flow source is hidden from Renders
The problem in this case was that the flag for active fire was not set. With hidden flow sources the flag was not updated in update_flowsflags().
The solution for this is to take the active field from the config cache file.
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 019230572ef..0014fd7cb7e 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -3858,7 +3858,15 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd, has_mesh = manta_has_mesh(fds->fluid, fmd, scene_framenr); has_particles = manta_has_particles(fds->fluid, fmd, scene_framenr); has_guide = manta_has_guiding(fds->fluid, fmd, scene_framenr, guide_parent); - has_config = false; + has_config = manta_read_config(fds->fluid, fmd, scene_framenr); + + /* When reading data from cache (has_config == true) ensure that active fields are allocated. + * update_flowsflags() and update_obstacleflags() will not find flow sources hidden from renders. + * See also: T72192. */ + if (has_config) { + ensure_flowsfields(fds); + ensure_obstaclefields(fds); + } bool baking_data, baking_noise, baking_mesh, baking_particles, baking_guide; baking_data = fds->cache_flag & FLUID_DOMAIN_BAKING_DATA; @@ -3975,7 +3983,8 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd, /* Read mesh cache. */ if (with_liquid && with_mesh) { - has_config = manta_read_config(fds->fluid, fmd, mesh_frame); + if (mesh_frame != scene_framenr) + has_config = manta_read_config(fds->fluid, fmd, mesh_frame); /* Update mesh data from file is faster than via Python (manta_read_mesh()). */ has_mesh = manta_read_mesh(fds->fluid, fmd, mesh_frame); @@ -3983,7 +3992,8 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd, /* Read particles cache. */ if (with_liquid && with_particles) { - has_config = manta_read_config(fds->fluid, fmd, particles_frame); + if (particles_frame != scene_framenr) + has_config = manta_read_config(fds->fluid, fmd, particles_frame); read_partial = !baking_data && !baking_particles && next_particles; read_all = !read_partial && with_resumable_cache; @@ -3998,7 +4008,8 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd, /* Read noise and data cache */ if (with_smoke && with_noise) { - has_config = manta_read_config(fds->fluid, fmd, noise_frame); + if (noise_frame != scene_framenr) + has_config = manta_read_config(fds->fluid, fmd, noise_frame); /* Only reallocate when just reading cache or when resuming during bake. */ if (has_data && has_config && manta_needs_realloc(fds->fluid, fmd)) { @@ -4016,7 +4027,8 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd, } /* Read data cache only */ else { - has_config = manta_read_config(fds->fluid, fmd, data_frame); + if (data_frame != scene_framenr) + has_config = manta_read_config(fds->fluid, fmd, data_frame); if (with_smoke) { /* Read config and realloc fluid object if needed. */ |