From 9fe64948abe991d18c1af3a52d81e87c24d39687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Barschkis?= Date: Wed, 24 Jun 2020 12:00:13 +0200 Subject: Fluid: Updated Mantaflow source with latest OpenVDB changes This updated set of Mantaflow files includes the improved OpenVDB file IO. With this update it is finally possible to store multiple grids per file. It is also possible to save particle systems and particle data to OpenVDB files. --- extern/mantaflow/preprocessed/grid.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'extern/mantaflow/preprocessed/grid.h') diff --git a/extern/mantaflow/preprocessed/grid.h b/extern/mantaflow/preprocessed/grid.h index fe386cfc269..a7aac80891a 100644 --- a/extern/mantaflow/preprocessed/grid.h +++ b/extern/mantaflow/preprocessed/grid.h @@ -409,7 +409,7 @@ template class Grid : public GridBase { typedef T BASETYPE; typedef GridBase BASETYPE_GRID; - void save(std::string name); + int save(std::string name); static PyObject *_W_10(PyObject *_self, PyObject *_linargs, PyObject *_kwds) { try { @@ -422,8 +422,7 @@ template class Grid : public GridBase { ArgLocker _lock; std::string name = _args.get("name", 0, &_lock); pbo->_args.copy(_args); - _retval = getPyNone(); - pbo->save(name); + _retval = toPy(pbo->save(name)); pbo->_args.check(); } pbFinalizePlugin(pbo->getParent(), "Grid::save", !noTiming); @@ -435,7 +434,7 @@ template class Grid : public GridBase { } } - void load(std::string name); + int load(std::string name); static PyObject *_W_11(PyObject *_self, PyObject *_linargs, PyObject *_kwds) { try { @@ -448,8 +447,7 @@ template class Grid : public GridBase { ArgLocker _lock; std::string name = _args.get("name", 0, &_lock); pbo->_args.copy(_args); - _retval = getPyNone(); - pbo->load(name); + _retval = toPy(pbo->load(name)); pbo->_args.check(); } pbFinalizePlugin(pbo->getParent(), "Grid::load", !noTiming); @@ -554,6 +552,12 @@ template class Grid : public GridBase { return mData[idx]; } + //! set data + inline void set(int i, int j, int k, T &val) + { + mData[index(i, j, k)] = val; + } + // interpolated access inline T getInterpolated(const Vec3 &pos) const { -- cgit v1.2.3