[Bf-blender-cvs] [c2691c93d51] blender-v2.90-release: Fix T79201: Mantaflow: Fluid guides don't affect simulation.

Sebastián Barschkis noreply at git.blender.org
Fri Aug 7 15:50:14 CEST 2020


Commit: c2691c93d51409a987381171af920eeec30e484f
Author: Sebastián Barschkis
Date:   Fri Aug 7 15:33:51 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBc2691c93d51409a987381171af920eeec30e484f

Fix T79201: Mantaflow: Fluid guides don't affect simulation.

This broke during the OpenVDB update for 2.90. Just making sure that guiding velocity files are being read correctly.

===================================================================

M	extern/mantaflow/preprocessed/gitinfo.h
M	extern/mantaflow/preprocessed/grid.h
M	extern/mantaflow/preprocessed/grid.h.reg.cpp
M	intern/mantaflow/intern/MANTA_main.cpp
M	intern/mantaflow/intern/strings/fluid_script.h
M	source/blender/makesdna/DNA_fluid_types.h

===================================================================

diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index ce088d6c400..e87c8739cf4 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
 
 
-#define MANTA_GIT_VERSION "commit 841bfd09c068dfb95637c0ec14fa78305286a433"
+#define MANTA_GIT_VERSION "commit e2f6e59e3679f88e5100ae2145410cca4971b9df"
diff --git a/extern/mantaflow/preprocessed/grid.h b/extern/mantaflow/preprocessed/grid.h
index a7aac80891a..9bd4e5d72d9 100644
--- a/extern/mantaflow/preprocessed/grid.h
+++ b/extern/mantaflow/preprocessed/grid.h
@@ -355,6 +355,38 @@ class GridBase : public PbClass {
     return isInBounds(Vec3i(i, j, k), bnd);
   }
 
+#ifdef BLENDER
+  //! expose name field to Python for Blender
+  void setName(const std::string &name)
+  {
+    mName = name;
+  }
+  static PyObject *_W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  {
+    try {
+      PbArgs _args(_linargs, _kwds);
+      GridBase *pbo = dynamic_cast<GridBase *>(Pb::objFromPy(_self));
+      bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
+      pbPreparePlugin(pbo->getParent(), "GridBase::setName", !noTiming);
+      PyObject *_retval = 0;
+      {
+        ArgLocker _lock;
+        const std::string &name = _args.get<std::string>("name", 0, &_lock);
+        pbo->_args.copy(_args);
+        _retval = getPyNone();
+        pbo->setName(name);
+        pbo->_args.check();
+      }
+      pbFinalizePlugin(pbo->getParent(), "GridBase::setName", !noTiming);
+      return _retval;
+    }
+    catch (std::exception &e) {
+      pbSetError("GridBase::setName", e.what());
+      return 0;
+    }
+  }
+
+#endif
  protected:
   GridType mType;
   Vec3i mSize;
@@ -373,7 +405,7 @@ template<class T> class Grid : public GridBase {
  public:
   //! init new grid, values are set to zero
   Grid(FluidSolver *parent, bool show = true);
-  static int _W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static int _W_10(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     PbClass *obj = Pb::objFromPy(_self);
     if (obj)
@@ -410,7 +442,7 @@ template<class T> class Grid : public GridBase {
   typedef GridBase BASETYPE_GRID;
 
   int save(std::string name);
-  static PyObject *_W_10(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_11(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -435,7 +467,7 @@ template<class T> class Grid : public GridBase {
   }
 
   int load(std::string name);
-  static PyObject *_W_11(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_12(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -461,7 +493,7 @@ template<class T> class Grid : public GridBase {
 
   //! set all cells to zero
   void clear();
-  static PyObject *_W_12(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_13(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -588,7 +620,7 @@ template<class T> class Grid : public GridBase {
   // Grid<T>& operator=(const Grid<T>& a);
   //! copy content from other grid (use this one instead of operator= !)
   Grid<T> &copyFrom(const Grid<T> &a, bool copyType = true);
-  static PyObject *_W_13(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_14(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -618,7 +650,7 @@ template<class T> class Grid : public GridBase {
 
   //! get grid type
   int getGridType();
-  static PyObject *_W_14(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_15(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -643,7 +675,7 @@ template<class T> class Grid : public GridBase {
 
   //! add/subtract other grid
   void add(const Grid<T> &a);
-  static PyObject *_W_15(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_16(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -669,7 +701,7 @@ template<class T> class Grid : public GridBase {
   }
 
   void sub(const Grid<T> &a);
-  static PyObject *_W_16(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_17(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -696,7 +728,7 @@ template<class T> class Grid : public GridBase {
 
   //! set all cells to constant value
   void setConst(T s);
-  static PyObject *_W_17(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_18(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -723,7 +755,7 @@ template<class T> class Grid : public GridBase {
 
   //! add constant to all grid cells
   void addConst(T s);
-  static PyObject *_W_18(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_19(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -750,7 +782,7 @@ template<class T> class Grid : public GridBase {
 
   //! add scaled other grid to current one (note, only "Real" factor, "T" type not supported here!)
   void addScaled(const Grid<T> &a, const T &factor);
-  static PyObject *_W_19(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_20(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -778,7 +810,7 @@ template<class T> class Grid : public GridBase {
 
   //! multiply contents of grid
   void mult(const Grid<T> &a);
-  static PyObject *_W_20(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_21(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -805,7 +837,7 @@ template<class T> class Grid : public GridBase {
 
   //! multiply each cell by a constant scalar value
   void multConst(T s);
-  static PyObject *_W_21(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_22(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -832,7 +864,7 @@ template<class T> class Grid : public GridBase {
 
   //! safely divide contents of grid (with zero check)
   Grid<T> &safeDivide(const Grid<T> &a);
-  static PyObject *_W_22(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_23(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -858,7 +890,7 @@ template<class T> class Grid : public GridBase {
 
   //! clamp content to range (for vec3, clamps each component separately)
   void clamp(Real min, Real max);
-  static PyObject *_W_23(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_24(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -886,7 +918,7 @@ template<class T> class Grid : public GridBase {
 
   //! reduce small values to zero
   void stomp(const T &threshold);
-  static PyObject *_W_24(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_25(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -913,7 +945,7 @@ template<class T> class Grid : public GridBase {
 
   //! permute grid axes, e.g. switch y with z (0,2,1)
   void permuteAxes(int axis0, int axis1, int axis2);
-  static PyObject *_W_25(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_26(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -942,7 +974,7 @@ template<class T> class Grid : public GridBase {
 
   //! permute grid axes, e.g. switch y with z (0,2,1)
   void permuteAxesCopyToGrid(int axis0, int axis1, int axis2, Grid<T> &out);
-  static PyObject *_W_26(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -972,7 +1004,7 @@ template<class T> class Grid : public GridBase {
 
   //! join other grid by either keeping min or max value at cell
   void join(const Grid<T> &a, bool keepMax = true);
-  static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -1001,7 +1033,7 @@ template<class T> class Grid : public GridBase {
   // common compound operators
   //! get absolute max value in grid
   Real getMaxAbs() const;
-  static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -1026,7 +1058,7 @@ template<class T> class Grid : public GridBase {
 
   //! get max value in grid
   Real getMax() const;
-  static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -1051,7 +1083,7 @@ template<class T> class Grid : public GridBase {
 
   //! get min value in grid
   Real getMin() const;
-  static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -1076,7 +1108,7 @@ template<class T> class Grid : public GridBase {
 
   //! calculate L1 norm of grid content
   Real getL1(int bnd = 0);
-  static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+  static PyObject *_W_32(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
   {
     try {
       PbArgs _args(_linargs, _kwds);
@@ -1102,7 +1134,7 @@ template<class T> cla

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list