[Bf-blender-cvs] [6b6e2e742ff] master: Fluid: Updated Mantaflow source files
SebastiaÌn Barschkis
noreply at git.blender.org
Tue Jul 21 15:22:58 CEST 2020
Commit: 6b6e2e742ff4393a73e982e0a3d6dae934ad20f2
Author: Sebastián Barschkis
Date: Tue Jul 21 15:22:21 2020 +0200
Branches: master
https://developer.blender.org/rB6b6e2e742ff4393a73e982e0a3d6dae934ad20f2
Fluid: Updated Mantaflow source files
Updated files include fixes for the mesh IO - read/write success was not propagated.
===================================================================
M extern/mantaflow/preprocessed/gitinfo.h
M extern/mantaflow/preprocessed/mesh.cpp
M extern/mantaflow/preprocessed/mesh.h
M extern/mantaflow/preprocessed/mesh.h.reg.cpp
===================================================================
diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index 5763d31f7fb..3271a858911 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
-#define MANTA_GIT_VERSION "commit 78ecf1940765e45d8fc15b3304a622785a84939e"
+#define MANTA_GIT_VERSION "commit 3370c2014ad7192041cb4fbed19ed74ae9725fb5"
diff --git a/extern/mantaflow/preprocessed/mesh.cpp b/extern/mantaflow/preprocessed/mesh.cpp
index 7a27b88ece7..6a9b0283bef 100644
--- a/extern/mantaflow/preprocessed/mesh.cpp
+++ b/extern/mantaflow/preprocessed/mesh.cpp
@@ -213,34 +213,36 @@ Mesh &Mesh::operator=(const Mesh &o)
return *this;
}
-void Mesh::load(string name, bool append)
+int Mesh::load(string name, bool append)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".gz") // assume bobj gz
- readBobjFile(name, this, append);
+ return readBobjFile(name, this, append);
else if (ext == ".obj")
- readObjFile(name, this, append);
+ return readObjFile(name, this, append);
else
errMsg("file '" + name + "' filetype not supported");
// dont always rebuild...
// rebuildCorners();
// rebuildLookup();
+ return 0;
}
-void Mesh::save(string name)
+int Mesh::save(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".obj")
- writeObjFile(name, this);
+ return writeObjFile(name, this);
else if (ext == ".gz")
- writeBobjFile(name, this);
+ return writeBobjFile(name, this);
else
errMsg("file '" + name + "' filetype not supported");
+ return 0;
}
void Mesh::fromShape(Shape &shape, bool append)
@@ -1379,30 +1381,32 @@ void Mesh::updateDataFields()
}
}
-template<typename T> void MeshDataImpl<T>::load(string name)
+template<typename T> int MeshDataImpl<T>::load(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".uni")
- readMdataUni<T>(name, this);
+ return readMdataUni<T>(name, this);
else if (ext == ".raw") // raw = uni for now
- readMdataUni<T>(name, this);
+ return readMdataUni<T>(name, this);
else
errMsg("mesh data '" + name + "' filetype not supported for loading");
+ return 0;
}
-template<typename T> void MeshDataImpl<T>::save(string name)
+template<typename T> int MeshDataImpl<T>::save(string name)
{
if (name.find_last_of('.') == string::npos)
errMsg("file '" + name + "' does not have an extension");
string ext = name.substr(name.find_last_of('.'));
if (ext == ".uni")
- writeMdataUni<T>(name, this);
+ return writeMdataUni<T>(name, this);
else if (ext == ".raw") // raw = uni for now
- writeMdataUni<T>(name, this);
+ return writeMdataUni<T>(name, this);
else
errMsg("mesh data '" + name + "' filetype not supported for saving");
+ return 0;
}
// specializations
diff --git a/extern/mantaflow/preprocessed/mesh.h b/extern/mantaflow/preprocessed/mesh.h
index f49619515ce..4235b9508af 100644
--- a/extern/mantaflow/preprocessed/mesh.h
+++ b/extern/mantaflow/preprocessed/mesh.h
@@ -240,215 +240,214 @@ class Mesh : public PbClass {
}
}
- void load(std::string name, bool append = false);
+ void fromShape(Shape &shape, bool append = false);
static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::load", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- std::string name = _args.get<std::string>("name", 0, &_lock);
+ Shape &shape = *_args.getPtr<Shape>("shape", 0, &_lock);
bool append = _args.getOpt<bool>("append", 1, false, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->load(name, append);
+ pbo->fromShape(shape, append);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::load", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::load", e.what());
+ pbSetError("Mesh::fromShape", e.what());
return 0;
}
}
- void fromShape(Shape &shape, bool append = false);
+ void advectInGrid(FlagGrid &flags, MACGrid &vel, int integrationMode);
static PyObject *_W_3(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Shape &shape = *_args.getPtr<Shape>("shape", 0, &_lock);
- bool append = _args.getOpt<bool>("append", 1, false, &_lock);
+ FlagGrid &flags = *_args.getPtr<FlagGrid>("flags", 0, &_lock);
+ MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
+ int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->fromShape(shape, append);
+ pbo->advectInGrid(flags, vel, integrationMode);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::fromShape", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::fromShape", e.what());
+ pbSetError("Mesh::advectInGrid", e.what());
return 0;
}
}
- void save(std::string name);
+ void scale(Vec3 s);
static PyObject *_W_4(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::save", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- std::string name = _args.get<std::string>("name", 0, &_lock);
+ Vec3 s = _args.get<Vec3>("s", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->save(name);
+ pbo->scale(s);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::save", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::save", e.what());
+ pbSetError("Mesh::scale", e.what());
return 0;
}
}
- void advectInGrid(FlagGrid &flags, MACGrid &vel, int integrationMode);
+ void offset(Vec3 o);
static PyObject *_W_5(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- FlagGrid &flags = *_args.getPtr<FlagGrid>("flags", 0, &_lock);
- MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
- int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
+ Vec3 o = _args.get<Vec3>("o", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->advectInGrid(flags, vel, integrationMode);
+ pbo->offset(o);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::advectInGrid", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::advectInGrid", e.what());
+ pbSetError("Mesh::offset", e.what());
return 0;
}
}
- void scale(Vec3 s);
+ void rotate(Vec3 thetas);
static PyObject *_W_6(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
+ pbPreparePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
PyObject *_retval = 0;
{
ArgLocker _lock;
- Vec3 s = _args.get<Vec3>("s", 0, &_lock);
+ Vec3 thetas = _args.get<Vec3>("thetas", 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->scale(s);
+ pbo->rotate(thetas);
pbo->_args.check();
}
- pbFinalizePlugin(pbo->getParent(), "Mesh::scale", !noTiming);
+ pbFinalizePlugin(pbo->getParent(), "Mesh::rotate", !noTiming);
return _retval;
}
catch (std::exception &e) {
- pbSetError("Mesh::scale", e.what());
+ pbSetError("Mesh::rotate", e.what());
return 0;
}
}
- void offset(Vec3 o);
+ void computeVelocity(Mesh &oldMesh, MACGrid &vel);
static PyObject *_W_7(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
Mesh *pbo = dynamic_cast<Mesh *>(Pb::objFromPy(_self));
bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
- pbPreparePlugin(pbo->getParent(), "Mesh::offset", !noTiming);
+ pbPrep
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list