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.
This commit is contained in:
2020-08-04 18:09:03 +02:00
parent f2ac432467
commit df28a68e70

View File

@@ -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. */