Fluid: Potential fix for Eevee tests crashing with Mantaflow
Belongs to T73921. This commit fixes the crashes with light baking (disabled in f3a33a9298). There is still a memory leak to be fixed though.
This commit is contained in:
@@ -171,8 +171,7 @@ MANTA::MANTA(int *res, FluidModifierData *mmd) : mCurrentID(++solverID)
|
|||||||
mMeshFromFile = false;
|
mMeshFromFile = false;
|
||||||
mParticlesFromFile = false;
|
mParticlesFromFile = false;
|
||||||
|
|
||||||
// Only start Mantaflow once. No need to start whenever new FLUID objected is allocated
|
// Setup Mantaflow in Python
|
||||||
if (!mantaInitialized)
|
|
||||||
initializeMantaflow();
|
initializeMantaflow();
|
||||||
|
|
||||||
// Initialize Mantaflow variables in Python
|
// Initialize Mantaflow variables in Python
|
||||||
|
|||||||
@@ -3674,8 +3674,9 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *mmd,
|
|||||||
|
|
||||||
/* Reset fluid if no fluid present (obviously)
|
/* Reset fluid if no fluid present (obviously)
|
||||||
* or if timeline gets reset to startframe */
|
* or if timeline gets reset to startframe */
|
||||||
if (!mds->fluid || is_startframe) {
|
if (!mds->fluid) {
|
||||||
BKE_fluid_modifier_reset_ex(mmd, false);
|
BKE_fluid_modifier_reset_ex(mmd, false);
|
||||||
|
BKE_fluid_modifier_init(mmd, depsgraph, ob, scene, me);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Guiding parent res pointer needs initialization */
|
/* Guiding parent res pointer needs initialization */
|
||||||
@@ -3687,8 +3688,6 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *mmd,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BKE_fluid_modifier_init(mmd, depsgraph, ob, scene, me);
|
|
||||||
|
|
||||||
/* ensure that time parameters are initialized correctly before every step */
|
/* ensure that time parameters are initialized correctly before every step */
|
||||||
float fps = scene->r.frs_sec / scene->r.frs_sec_base;
|
float fps = scene->r.frs_sec / scene->r.frs_sec_base;
|
||||||
mds->frame_length = DT_DEFAULT * (25.0f / fps) * mds->time_scale;
|
mds->frame_length = DT_DEFAULT * (25.0f / fps) * mds->time_scale;
|
||||||
|
|||||||
Reference in New Issue
Block a user