diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-05 16:58:15 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-05 16:58:15 +0300 |
commit | 60c208e2d604aae033ff3324f4fe7ee7c1364b58 (patch) | |
tree | 20d05956ce6e5f88bace932b0d54866c478f8291 /source/blender | |
parent | 950a35e35380dc84a4ca7dbff2837cc17a05d85e (diff) |
Fluid: Fix initial velocities for new static emission mode
For now, disabling static mode whenever initial velocities are being used.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 70595bfb1a3..a803c0123f6 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -2708,6 +2708,7 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, int subframes = mfs->subframes; EmissionMap *em = &emaps[flow_index]; + bool use_velocity = mfs->flags & FLUID_FLOW_INITVELOCITY; bool is_static = is_static_object(flowobj); /* Cannot use static mode with adaptive domain. * The adaptive domain might expand and only later in the simulations discover the static @@ -2735,8 +2736,9 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, continue; } /* Optimization: Static liquid flow objects don't need emission computation after first - * frame. */ - if (mfs->type == FLUID_FLOW_TYPE_LIQUID && is_static && !is_first_frame) { + * frame. + * TODO (sebbas): Also do not use static mode if inital velocities are enabled. */ + if (mfs->type == FLUID_FLOW_TYPE_LIQUID && is_static && !is_first_frame && !use_velocity) { continue; } @@ -2932,6 +2934,7 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, if ((mmd2->type & MOD_FLUID_TYPE_FLOW) && mmd2->flow) { FluidFlowSettings *mfs = mmd2->flow; + bool use_velocity = mfs->flags & FLUID_FLOW_INITVELOCITY; bool use_inflow = (mfs->flags & FLUID_FLOW_USE_INFLOW); bool is_liquid = (mfs->type == FLUID_FLOW_TYPE_LIQUID); bool is_inflow = (mfs->behavior == FLUID_FLOW_BEHAVIOR_INFLOW); @@ -2953,8 +2956,9 @@ static void update_flowsfluids(struct Depsgraph *depsgraph, /* Optimization: Liquid objects don't always need emission application after first frame. */ if (is_liquid && !is_first_frame) { - /* Skip static liquid objects that are not on the first frame. */ - if (is_static) { + /* Skip static liquid objects that are not on the first frame. + * TODO (sebbas): Also do not use static mode if inital velocities are enabled. */ + if (is_static && !use_velocity) { continue; } /* Liquid geometry objects don't need emission application after first frame. */ |