commit 4a2c116053be7d445f061bee074796dc87529b3f Author: Bartosz Kosiorek Date: Fri May 2 19:59:49 2025 +0200 Physics: Dissolve smoke independently from number of timesteps in Frame Fixes: 80529 diff --git a/extern/mantaflow/preprocessed/plugin/extforces.cpp b/extern/mantaflow/preprocessed/plugin/extforces.cpp index 88935fa7ae9..eaf3e7d39f4 100644 --- a/extern/mantaflow/preprocessed/plugin/extforces.cpp +++ b/extern/mantaflow/preprocessed/plugin/extforces.cpp @@ -1652,10 +1652,11 @@ void dissolveSmoke(const FlagGrid &flags, Grid *green = nullptr, Grid *blue = nullptr, int speed = 5, - bool logFalloff = true) + bool logFalloff = true, + const float dissolveScale = 1.0) { - float dydx = 1.0f / (float)speed; // max density/speed = dydx - float fac = 1.0f - dydx; + const float dydx = dissolveScale / (float)speed; // max density (1.0) * scale / speed = dydx + const float fac = 1.0f - dydx; KnDissolveSmoke(flags, density, heat, red, green, blue, speed, logFalloff, dydx, fac); } static PyObject *_W_11(PyObject *_self, PyObject *_linargs, PyObject *_kwds) @@ -1676,8 +1677,9 @@ static PyObject *_W_11(PyObject *_self, PyObject *_linargs, PyObject *_kwds) Grid *blue = _args.getPtrOpt>("blue", 5, nullptr, &_lock); int speed = _args.getOpt("speed", 6, 5, &_lock); bool logFalloff = _args.getOpt("logFalloff", 7, true, &_lock); + const float dissolveScale = _args.getOpt("dissolveScale", 8, 1.0, &_lock); _retval = getPyNone(); - dissolveSmoke(flags, density, heat, red, green, blue, speed, logFalloff); + dissolveSmoke(flags, density, heat, red, green, blue, speed, logFalloff, dissolveScale); _args.check(); } pbFinalizePlugin(parent, "dissolveSmoke", !noTiming);