diff options
author | Julian Eisel <julian@blender.org> | 2020-07-01 18:13:57 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-07-01 18:13:57 +0300 |
commit | 0829cebeb024095c268f190c34daa8ae9a5a224c (patch) | |
tree | 12ee5a4a1c2a32e12eff47c8eb9bb0ed217791c1 /extern/mantaflow/preprocessed/grid.h | |
parent | cfde6ebf450594faa57c4bfeaecff10fe512c91b (diff) | |
parent | 42be3964eb201180f6b0fa1ff6ce43b8c3845bc2 (diff) |
Merge branch 'master' into asset-uuid--archivedasset-uuid--archived
Diffstat (limited to 'extern/mantaflow/preprocessed/grid.h')
-rw-r--r-- | extern/mantaflow/preprocessed/grid.h | 16 |
1 files changed, 10 insertions, 6 deletions
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 T> 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 T> class Grid : public GridBase { ArgLocker _lock; std::string name = _args.get<std::string>("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 T> 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 T> class Grid : public GridBase { ArgLocker _lock; std::string name = _args.get<std::string>("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 T> 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 { |