Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/mantaflow/preprocessed/fileio/mantaio.cpp')
-rw-r--r--extern/mantaflow/preprocessed/fileio/mantaio.cpp16
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);