diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-10-13 22:36:14 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-10-14 01:29:43 +0300 |
commit | 2ec07dfa182d4503ccf3930406e8c7b239751e18 (patch) | |
tree | 1ca92d00600075300a06f169ee5f36750abcb577 /extern/mantaflow/preprocessed/fileio/mantaio.cpp | |
parent | 5f49f818d6282a2f421f454bb32b2a6b2c9a0a0d (diff) |
Fluid: Update Mantaflow source files
Updated files includes:
- Fix for smoke / fire emission from particles
- Custom precision for liquid particles when saving in OpenVDB format
Diffstat (limited to 'extern/mantaflow/preprocessed/fileio/mantaio.cpp')
-rw-r--r-- | extern/mantaflow/preprocessed/fileio/mantaio.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/extern/mantaflow/preprocessed/fileio/mantaio.cpp b/extern/mantaflow/preprocessed/fileio/mantaio.cpp index fd2b36bf7cb..a03bd98d449 100644 --- a/extern/mantaflow/preprocessed/fileio/mantaio.cpp +++ b/extern/mantaflow/preprocessed/fileio/mantaio.cpp @@ -82,8 +82,15 @@ int save(const string &name, float worldSize = 1.0, bool skipDeletedParts = false, int compression = COMPRESSION_ZIP, - bool precisionHalf = true) + bool precisionHalf = true, + int precision = PRECISION_HALF) { + + if (!precisionHalf) { + debMsg("Warning: precisionHalf argument is deprecated. Please use precision level instead", 0); + precision = PRECISION_HALF; // for backwards compatibility + } + if (name.find_last_of('.') == string::npos) errMsg("file '" + name + "' does not have an extension"); string ext = name.substr(name.find_last_of('.')); @@ -95,8 +102,7 @@ int save(const string &name, else if (ext == ".vol") return writeGridsVol(name, &objects); if (ext == ".vdb") - return writeObjectsVDB( - name, &objects, worldSize, skipDeletedParts, compression, precisionHalf); + return writeObjectsVDB(name, &objects, worldSize, skipDeletedParts, compression, precision); else if (ext == ".npz") return writeGridsNumpy(name, &objects); else if (ext == ".txt") @@ -122,7 +128,9 @@ static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds) bool skipDeletedParts = _args.getOpt<bool>("skipDeletedParts", 3, false, &_lock); int compression = _args.getOpt<int>("compression", 4, COMPRESSION_ZIP, &_lock); bool precisionHalf = _args.getOpt<bool>("precisionHalf", 5, true, &_lock); - _retval = toPy(save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf)); + int precision = _args.getOpt<int>("precision", 6, PRECISION_HALF, &_lock); + _retval = toPy( + save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf, precision)); _args.check(); } pbFinalizePlugin(parent, "save", !noTiming); |