diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-07-26 23:01:42 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-07-26 23:02:10 +0300 |
commit | 04195b1e743c86550fb2d1836c882eff875dec85 (patch) | |
tree | 5967c4e001dec3a64963c838de5a173a6b9cd47d /intern/mantaflow | |
parent | 2ebf263f5c3d23084e09cff02eac138a1fd8619f (diff) |
Fluid: Added new option to control the maximum number fluid particles in the simulation
New option that lets users the define the maximum number of fluid particles that will be allowed in the simulation. This can come in handy, for example, to ensure that the particle count will not exceed the hardware capabilities, or to avoid excessive amounts of particles in a scene.
Diffstat (limited to 'intern/mantaflow')
-rw-r--r-- | intern/mantaflow/intern/MANTA_main.cpp | 1 | ||||
-rw-r--r-- | intern/mantaflow/intern/strings/liquid_script.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp index 676a2fd785e..5b2cbb09979 100644 --- a/intern/mantaflow/intern/MANTA_main.cpp +++ b/intern/mantaflow/intern/MANTA_main.cpp @@ -876,6 +876,7 @@ void MANTA::initializeRNAMap(FluidModifierData *fmd) mRNAMap["CACHE_DIR"] = cacheDirectory; mRNAMap["COMPRESSION_OPENVDB"] = vdbCompressionMethod; mRNAMap["PRECISION_OPENVDB"] = vdbPrecisionHalf; + mRNAMap["PP_PARTICLE_MAXIMUM"] = to_string(fds->sys_particle_maximum); /* Fluid object names. */ mRNAMap["NAME_FLAGS"] = FLUID_NAME_FLAGS; diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h index f4e181873b8..08d8dcd7de3 100644 --- a/intern/mantaflow/intern/strings/liquid_script.h +++ b/intern/mantaflow/intern/strings/liquid_script.h @@ -48,7 +48,8 @@ meshRadiusFactor_s$ID$ = $MESH_PARTICLE_RADIUS$\n\ smoothenPos_s$ID$ = $MESH_SMOOTHEN_POS$\n\ smoothenNeg_s$ID$ = $MESH_SMOOTHEN_NEG$\n\ randomness_s$ID$ = $PARTICLE_RANDOMNESS$\n\ -surfaceTension_s$ID$ = $LIQUID_SURFACE_TENSION$\n"; +surfaceTension_s$ID$ = $LIQUID_SURFACE_TENSION$\n\ +maxSysParticles_s$ID$ = $PP_PARTICLE_MAXIMUM$\n"; const std::string liquid_variables_particles = "\n\ @@ -216,6 +217,7 @@ def liquid_adaptive_step_$ID$(framenr):\n\ else:\n\ pVel_pp$ID$.setSource(grid=None, isMAC=False)\n\ \n\ + pp_s$ID$.maxParticles = maxSysParticles_s$ID$ # remember, 0 means no particle cap\n\ sampleLevelsetWithParticles(phi=phiIn_s$ID$, flags=flags_s$ID$, parts=pp_s$ID$, discretization=particleNumber_s$ID$, randomness=randomness_s$ID$)\n\ flags_s$ID$.updateFromLevelset(phi_s$ID$)\n\ \n\ |