mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #157854: Fluid domain mesh missing in F12 render
Fix #157854: Fluid domain mesh missing in F12 render ## Problem Baked Mantaflow meshes are visible in the viewport but missing during F12 render. ## Cause During render evaluation (`DAG_EVAL_RENDER`), the depsgraph builds a fresh context. In `fluid_modifier_processDomain`, cache reading (`manta_read_mesh`, etc.) was attempted before the fluid object was reallocated to match the cached configuration. When `manta_needs_realloc` returned true, cache reading was skipped, causing a fallback to the domain bounding box instead of the baked mesh. ## Solution Move `BKE_fluid_reallocate_fluid` to the start of the `if (read_cache)` block so the fluid object is always correctly allocated before reading cache data. This ensures cache loading works correctly during render evaluation.  Fixes #157854 Pull Request: https://projects.blender.org/blender/blender/pulls/157898
This commit is contained in:
parent
f508fa2671
commit
87d48ea687
1 changed files with 5 additions and 7 deletions
|
|
@ -3888,6 +3888,11 @@ static void fluid_modifier_processDomain(FluidModifierData *fmd,
|
|||
/* Try to read from cache and keep track of read success. */
|
||||
if (read_cache) {
|
||||
|
||||
/* Reallocate fluid object to match cached config before reading mesh/particles. */
|
||||
if (has_config && manta_needs_realloc(fds->fluid, fmd)) {
|
||||
BKE_fluid_reallocate_fluid(fds, fds->res, 1);
|
||||
}
|
||||
|
||||
/* Read mesh cache. */
|
||||
if (with_liquid && with_mesh) {
|
||||
if (mesh_frame != scene_framenr) {
|
||||
|
|
@ -3944,13 +3949,6 @@ static void fluid_modifier_processDomain(FluidModifierData *fmd,
|
|||
has_config = manta_read_config(fds->fluid, fmd, data_frame);
|
||||
}
|
||||
|
||||
if (with_smoke || with_liquid) {
|
||||
/* Read config and realloc fluid object if needed. */
|
||||
if (has_config && manta_needs_realloc(fds->fluid, fmd)) {
|
||||
BKE_fluid_reallocate_fluid(fds, fds->res, 1);
|
||||
}
|
||||
}
|
||||
|
||||
read_partial = !baking_data && !baking_particles && !baking_mesh && next_data &&
|
||||
!grid_display;
|
||||
read_all = !read_partial && with_resumable_cache;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue