Commit: 506cf7051f26685ad44ce643ca57a6101a775d66
Author: Sebastián Barschkis
Date:   Sun Jul 17 17:51:56 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB506cf7051f26685ad44ce643ca57a6101a775d66

distinguishing between phi and phi_init grid

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

M       intern/mantaflow/extern/manta_smoke_API.h
M       intern/mantaflow/intern/SMOKE.cpp
M       intern/mantaflow/intern/SMOKE.h
M       intern/mantaflow/intern/manta_smoke_API.cpp
M       source/blender/blenkernel/intern/smoke.c

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

diff --git a/intern/mantaflow/extern/manta_smoke_API.h 
b/intern/mantaflow/extern/manta_smoke_API.h
index d07cc81..1efab25 100644
--- a/intern/mantaflow/extern/manta_smoke_API.h
+++ b/intern/mantaflow/extern/manta_smoke_API.h
@@ -89,6 +89,7 @@ float *smoke_get_inflow_grid(struct SMOKE *smoke);
 float *smoke_get_fuel_inflow(struct SMOKE *smoke);
 
 float *liquid_get_phi(struct SMOKE *liquid);
+float *liquid_get_phiinit(struct SMOKE *liquid);
 float *liquid_turbulence_get_phi(struct SMOKE *liquid);
 void liquid_ensure_init(struct SMOKE *liquid, struct SmokeModifierData *smd);
 void liquid_save_mesh(struct SMOKE *liquid, char *filename);
diff --git a/intern/mantaflow/intern/SMOKE.cpp 
b/intern/mantaflow/intern/SMOKE.cpp
index 058532e..bf524cf 100644
--- a/intern/mantaflow/intern/SMOKE.cpp
+++ b/intern/mantaflow/intern/SMOKE.cpp
@@ -787,7 +787,8 @@ void SMOKE::updatePointers(SmokeModifierData *smd)
 
        // Liquid
        if (mUsingLiquid) {
-               mPhi        = (float*)         getGridPointer("phiInit",        
 "s");
+               mPhi        = (float*)         getGridPointer("phi",         
"s");
+               mPhiInit    = (float*)         getGridPointer("phiInit",        
 "s");
                mDensity    = (float*)         getGridPointer("density",        
 "s");
        }
        
diff --git a/intern/mantaflow/intern/SMOKE.h b/intern/mantaflow/intern/SMOKE.h
index 1f1f461..c2b5d0c 100644
--- a/intern/mantaflow/intern/SMOKE.h
+++ b/intern/mantaflow/intern/SMOKE.h
@@ -112,6 +112,7 @@ public:
        inline float* getTextureW2() { return mTextureW2; }
        
        inline float* getPhi()     { return mPhi; }
+       inline float* getPhiInit() { return mPhiInit; }
        inline float* getPhiHigh() { return NULL; } // Not yet implemented
 
        static bool mantaInitialized;
@@ -201,7 +202,9 @@ private:
        
        // Liquids
        float* mPhi;
+       float* mPhiInit;
        float* mPhiHigh;
+       
        // Mesh fields for liquid surface
        int mNumVertices;
        int mNumNormals;
diff --git a/intern/mantaflow/intern/manta_smoke_API.cpp 
b/intern/mantaflow/intern/manta_smoke_API.cpp
index 8b94842..e3fc8da 100644
--- a/intern/mantaflow/intern/manta_smoke_API.cpp
+++ b/intern/mantaflow/intern/manta_smoke_API.cpp
@@ -497,6 +497,11 @@ extern "C" float *liquid_get_phi(SMOKE *liquid)
        return liquid->getPhi();
 }
 
+extern "C" float *liquid_get_phiinit(SMOKE *liquid)
+{
+       return liquid->getPhiInit();
+}
+
 extern "C" void liquid_save_mesh(SMOKE *liquid, char *filename)
 {
        if (liquid) {
diff --git a/source/blender/blenkernel/intern/smoke.c 
b/source/blender/blenkernel/intern/smoke.c
index a26be8d..3f9befa 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2501,7 +2501,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, 
SmokeDomainSettings *sd
                                float *velocity_x = 
smoke_get_velocity_x(sds->fluid);
                                float *velocity_y = 
smoke_get_velocity_y(sds->fluid);
                                float *velocity_z = 
smoke_get_velocity_z(sds->fluid);
-                               float *phi = liquid_get_phi(sds->fluid);
+                               float *phi = liquid_get_phiinit(sds->fluid);
                                //unsigned char *obstacle = 
smoke_get_obstacle(sds->fluid);
                                // DG TODO UNUSED unsigned char *obstacleAnim = 
smoke_get_obstacle_anim(sds->fluid);
                                int bigres[3];

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to