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.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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\
|
||||
|
Reference in New Issue
Block a user