[Bf-blender-cvs] [bf8a73b4a7f] master: Fluid: Naming cleanup for flags grid

Sebastián Barschkis noreply at git.blender.org
Wed Mar 4 18:47:52 CET 2020


Commit: bf8a73b4a7f85c0ef9e38576b8b486aacfa40ae9
Author: Sebastián Barschkis
Date:   Wed Mar 4 17:32:47 2020 +0100
Branches: master
https://developer.blender.org/rBbf8a73b4a7f85c0ef9e38576b8b486aacfa40ae9

Fluid: Naming cleanup for flags grid

Use flags instead of obstacle to avoid confusion with obstacle levelset grid.

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

M	intern/mantaflow/extern/manta_fluid_API.h
M	intern/mantaflow/intern/MANTA_main.cpp
M	intern/mantaflow/intern/MANTA_main.h
M	intern/mantaflow/intern/manta_fluid_API.cpp
M	source/blender/blenkernel/intern/fluid.c

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

diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h
index 4ebedeb5e38..249eb2b4780 100644
--- a/intern/mantaflow/extern/manta_fluid_API.h
+++ b/intern/mantaflow/extern/manta_fluid_API.h
@@ -112,7 +112,7 @@ void manta_smoke_export(struct MANTA *smoke,
                         float **r,
                         float **g,
                         float **b,
-                        int **obstacles,
+                        int **flags,
                         float **shadow);
 void manta_smoke_turbulence_export(struct MANTA *smoke,
                                    float **dens,
@@ -152,7 +152,7 @@ float *manta_smoke_get_shadow(struct MANTA *fluid);
 float *manta_smoke_get_color_r(struct MANTA *smoke);
 float *manta_smoke_get_color_g(struct MANTA *smoke);
 float *manta_smoke_get_color_b(struct MANTA *smoke);
-int *manta_smoke_get_obstacle(struct MANTA *smoke);
+int *manta_smoke_get_flags(struct MANTA *smoke);
 float *manta_smoke_get_density_in(struct MANTA *smoke);
 float *manta_smoke_get_heat_in(struct MANTA *smoke);
 float *manta_smoke_get_color_r_in(struct MANTA *smoke);
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 89e505fcf97..34efe7a8c2d 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -103,7 +103,7 @@ MANTA::MANTA(int *res, FluidModifierData *mmd) : mCurrentID(++solverID)
   mColorR = nullptr;
   mColorG = nullptr;
   mColorB = nullptr;
-  mObstacle = nullptr;
+  mFlags = nullptr;
   mDensityIn = nullptr;
   mHeatIn = nullptr;
   mColorRIn = nullptr;
@@ -3005,7 +3005,7 @@ void MANTA::updatePointers()
   std::string mesh_ext2 = "_" + mesh2;
   std::string noise_ext = "_" + noise;
 
-  mObstacle = (int *)pyObjectToPointer(callPythonFunction("flags" + solver_ext, func));
+  mFlags = (int *)pyObjectToPointer(callPythonFunction("flags" + solver_ext, func));
   mPhiIn = (float *)pyObjectToPointer(callPythonFunction("phiIn" + solver_ext, func));
   mVelocityX = (float *)pyObjectToPointer(callPythonFunction("x_vel" + solver_ext, func));
   mVelocityY = (float *)pyObjectToPointer(callPythonFunction("y_vel" + solver_ext, func));
diff --git a/intern/mantaflow/intern/MANTA_main.h b/intern/mantaflow/intern/MANTA_main.h
index 105beaf6e20..8c99a64bf03 100644
--- a/intern/mantaflow/intern/MANTA_main.h
+++ b/intern/mantaflow/intern/MANTA_main.h
@@ -246,9 +246,9 @@ struct MANTA {
   {
     return mForceZ;
   }
-  inline int *getObstacle()
+  inline int *getFlags()
   {
-    return mObstacle;
+    return mFlags;
   }
   inline float *getNumObstacle()
   {
@@ -785,7 +785,7 @@ struct MANTA {
   float *mForceX;
   float *mForceY;
   float *mForceZ;
-  int *mObstacle;
+  int *mFlags;
   float *mNumObstacle;
   float *mNumGuide;
 
diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp
index 82bfed7cf61..47a643928e9 100644
--- a/intern/mantaflow/intern/manta_fluid_API.cpp
+++ b/intern/mantaflow/intern/manta_fluid_API.cpp
@@ -363,7 +363,7 @@ void manta_smoke_export(MANTA *smoke,
                         float **r,
                         float **g,
                         float **b,
-                        int **obstacle,
+                        int **flags,
                         float **shadow)
 {
   if (dens)
@@ -385,7 +385,7 @@ void manta_smoke_export(MANTA *smoke,
     *g = smoke->getColorG();
   if (b)
     *b = smoke->getColorB();
-  *obstacle = smoke->getObstacle();
+  *flags = smoke->getFlags();
   if (shadow)
     *shadow = smoke->getShadow();
   *dt = 1;  // dummy value, not needed for smoke
@@ -590,9 +590,9 @@ float *manta_smoke_get_color_b(MANTA *smoke)
   return smoke->getColorB();
 }
 
-int *manta_smoke_get_obstacle(MANTA *smoke)
+int *manta_smoke_get_flags(MANTA *smoke)
 {
-  return smoke->getObstacle();
+  return smoke->getFlags();
 }
 
 float *manta_smoke_get_density_in(MANTA *smoke)
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 7c5e9af728a..3df62a361f5 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -2834,7 +2834,7 @@ static void update_effectors(
     data.velocity_x = manta_get_velocity_x(mds->fluid);
     data.velocity_y = manta_get_velocity_y(mds->fluid);
     data.velocity_z = manta_get_velocity_z(mds->fluid);
-    data.flags = manta_smoke_get_obstacle(mds->fluid);
+    data.flags = manta_smoke_get_flags(mds->fluid);
     data.phi_obs_in = manta_get_phiobs_in(mds->fluid);
 
     TaskParallelSettings settings;



More information about the Bf-blender-cvs mailing list