diff options
Diffstat (limited to 'extern/mantaflow/preprocessed/fileio/mantaio.cpp')
-rw-r--r-- | extern/mantaflow/preprocessed/fileio/mantaio.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/extern/mantaflow/preprocessed/fileio/mantaio.cpp b/extern/mantaflow/preprocessed/fileio/mantaio.cpp index 3048572261a..fe29890ec11 100644 --- a/extern/mantaflow/preprocessed/fileio/mantaio.cpp +++ b/extern/mantaflow/preprocessed/fileio/mantaio.cpp @@ -83,7 +83,9 @@ int save(const string &name, bool skipDeletedParts = false, int compression = COMPRESSION_ZIP, bool precisionHalf = true, - int precision = PRECISION_HALF) + int precision = PRECISION_HALF, + float clip = 1e-4, + const Grid<Real> *clipGrid = nullptr) { if (!precisionHalf) { @@ -102,7 +104,8 @@ int save(const string &name, else if (ext == ".vol") return writeGridsVol(name, &objects); if (ext == ".vdb") - return writeObjectsVDB(name, &objects, worldSize, skipDeletedParts, compression, precision); + return writeObjectsVDB( + name, &objects, worldSize, skipDeletedParts, compression, precision, clip, clipGrid); else if (ext == ".npz") return writeGridsNumpy(name, &objects); else if (ext == ".txt") @@ -129,8 +132,17 @@ static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds) int compression = _args.getOpt<int>("compression", 4, COMPRESSION_ZIP, &_lock); bool precisionHalf = _args.getOpt<bool>("precisionHalf", 5, true, &_lock); int precision = _args.getOpt<int>("precision", 6, PRECISION_HALF, &_lock); - _retval = toPy( - save(name, objects, worldSize, skipDeletedParts, compression, precisionHalf, precision)); + float clip = _args.getOpt<float>("clip", 7, 1e-4, &_lock); + const Grid<Real> *clipGrid = _args.getPtrOpt<Grid<Real>>("clipGrid", 8, nullptr, &_lock); + _retval = toPy(save(name, + objects, + worldSize, + skipDeletedParts, + compression, + precisionHalf, + precision, + clip, + clipGrid)); _args.check(); } pbFinalizePlugin(parent, "save", !noTiming); |