[Bf-blender-cvs] [9f1b5cce636] fluid-mantaflow: cleanup: removed unused secondary particle type vector

Sebastián Barschkis noreply at git.blender.org
Wed Nov 29 19:12:23 CET 2017


Commit: 9f1b5cce63660768271eaeabed77e29f86c6b1bb
Author: Sebastián Barschkis
Date:   Sat Nov 25 11:24:20 2017 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB9f1b5cce63660768271eaeabed77e29f86c6b1bb

cleanup: removed unused secondary particle type vector

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

M	intern/mantaflow/extern/manta_fluid_API.h
M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/FLUID.h
M	intern/mantaflow/intern/manta_fluid_API.cpp
M	intern/mantaflow/intern/strings/shared_script.h
M	source/blender/blenkernel/intern/pointcache.c

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

diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h
index 5309b99d07e..e17f533907f 100644
--- a/intern/mantaflow/extern/manta_fluid_API.h
+++ b/intern/mantaflow/extern/manta_fluid_API.h
@@ -45,7 +45,7 @@ void smoke_step(struct FLUID *smoke, int framenr);
 void smoke_dissolve(struct FLUID *smoke, int speed, int log);
 void smoke_dissolve_wavelet(struct FLUID *smoke, int speed, int log);
 void smoke_export(struct FLUID *smoke, float *dt, float *dx, float **dens, float **react, float **flame, float **fuel, float **heat, float **vx, float **vy, float **vz, float **r, float **g, float **b, int **obstacles);
-void liquid_export(struct FLUID *liquid, float **phi, float **pp, float **pvel, float **ppSnd, float **pvelSnd, int **ptypeSnd, int **plifeSnd);
+void liquid_export(struct FLUID *liquid, float **phi, float **pp, float **pvel, float **ppSnd, float **pvelSnd, int **plifeSnd);
 void smoke_turbulence_export(struct FLUID *smoke, float **dens, float **react, float **flame, float **fuel, float **r, float **g, float **b , float **tcu, float **tcv, float **tcw, float **tcu2, float **tcv2, float **tcw2);
 float *smoke_get_density(struct FLUID *smoke);
 float *smoke_get_fuel(struct FLUID *smoke);
@@ -146,14 +146,12 @@ float liquid_get_flip_particle_velocity_z_at(struct FLUID *liquid, int i);
 float liquid_get_snd_particle_velocity_x_at(struct FLUID *liquid, int i);
 float liquid_get_snd_particle_velocity_y_at(struct FLUID *liquid, int i);
 float liquid_get_snd_particle_velocity_z_at(struct FLUID *liquid, int i);
-int liquid_get_snd_particle_type_at(struct FLUID *liquid, int i);
 
 void liquid_set_flip_particle_data(struct FLUID* liquid, float* buffer, int numParts);
 void liquid_set_snd_particle_data(struct FLUID* liquid, float* buffer, int numParts);
 
 void liquid_set_flip_particle_velocity(struct FLUID* liquid, float* buffer, int numParts);
 void liquid_set_snd_particle_velocity(struct FLUID* liquid, float* buffer, int numParts);
-void liquid_set_snd_particle_type(struct FLUID* liquid, int* buffer, int numParts);
 void liquid_set_snd_particle_life(struct FLUID* liquid, int* buffer, int numParts);
 
 // Fluids in general
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index d2547d3c72c..c6c0caf326d 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -150,7 +150,6 @@ FLUID::FLUID(int *res, SmokeModifierData *smd) : mCurrentID(++solverID)
 	mFlipParticleVelocity  = NULL;
 	mSndParticleData       = NULL;
 	mSndParticleVelocity   = NULL;
-	mSndParticleType       = NULL;
 	mSndParticleLife       = NULL;
 
 	// Only start Mantaflow once. No need to start whenever new FLUID objected is allocated
@@ -604,7 +603,6 @@ FLUID::~FLUID()
 	mFlipParticleVelocity  = NULL;
 	mSndParticleData       = NULL;
 	mSndParticleVelocity   = NULL;
-	mSndParticleType       = NULL;
 	mSndParticleLife       = NULL;
 
 	// Reset flags
@@ -1324,7 +1322,6 @@ void FLUID::updatePointers()
 		if (mUsingDrops || mUsingBubbles || mUsingFloats || mUsingTracers) {
 			mSndParticleData     = (std::vector<pData>*) getDataPointer("ppSnd" + solver_ext, solver);
 			mSndParticleVelocity = (std::vector<pVel>*)  getDataPointer("pVelSnd" + parts_ext, parts);
-			mSndParticleType     = (std::vector<int>*)   getDataPointer("pTypeSnd" + parts_ext, parts);
 			mSndParticleLife     = (std::vector<int>*)   getDataPointer("pLifeSnd" + parts_ext, parts);
 		}
 	}
@@ -1440,16 +1437,6 @@ void FLUID::setSndParticleVelocity(float* buffer, int numParts)
 	}
 }
 
-void FLUID::setSndParticleType(int* buffer, int numParts)
-{
-	mSndParticleType->resize(numParts);
-	int* bufferPType = buffer;
-	for (std::vector<int>::iterator it = mSndParticleType->begin(); it != mSndParticleType->end(); ++it) {
-		*it = *bufferPType;
-		bufferPType++;
-	}
-}
-
 void FLUID::setSndParticleLife(int* buffer, int numParts)
 {
 	mSndParticleLife->resize(numParts);
diff --git a/intern/mantaflow/intern/FLUID.h b/intern/mantaflow/intern/FLUID.h
index aaf1b00ec6a..f4f22524d62 100644
--- a/intern/mantaflow/intern/FLUID.h
+++ b/intern/mantaflow/intern/FLUID.h
@@ -190,15 +190,11 @@ public:
 	inline float getSndParticleVelocityYAt(int i) { return (mSndParticleVelocity) ? mSndParticleVelocity->at(i).pos[1] : 0.f; }
 	inline float getSndParticleVelocityZAt(int i) { return (mSndParticleVelocity) ? mSndParticleVelocity->at(i).pos[2] : 0.f; }
 
-	inline int getSndParticleTypeAt(int i) { return (mSndParticleType) ?  mSndParticleType->at(i) : -1; }
-	inline int getSndParticleLifeAt(int i) { return (mSndParticleLife) ?  mSndParticleLife->at(i) : -1; }
-
 	inline float* getFlipParticleData() { return (mFlipParticleData) ? (float*) &mFlipParticleData->front() : NULL; }
 	inline float* getSndParticleData()  { return (mSndParticleData) ? (float*) &mSndParticleData->front() : NULL; }
 
 	inline float* getFlipParticleVelocity() { return (mFlipParticleVelocity) ? (float*) &mFlipParticleVelocity->front() : NULL; }
 	inline float* getSndParticleVelocity()  { return (mSndParticleVelocity) ? (float*) &mSndParticleVelocity->front() : NULL; }
-	inline int*   getSndParticleType()      { return (mSndParticleType) ? (int*) &mSndParticleType->front() : NULL; }
 	inline int*   getSndParticleLife()      { return (mSndParticleLife) ? (int*) &mSndParticleLife->front() : NULL; }
 
 	inline int getNumFlipParticles() { return (mFlipParticleData) ? mFlipParticleData->size() : 0; }
@@ -318,7 +314,6 @@ private:
 
 	std::vector<pData>* mSndParticleData;
 	std::vector<pVel>* mSndParticleVelocity;
-	std::vector<int>* mSndParticleType;
 	std::vector<int>* mSndParticleLife;
 
 	void initDomain(struct SmokeModifierData *smd);
diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp
index dc3decbf5ba..4ec010e7cc4 100644
--- a/intern/mantaflow/intern/manta_fluid_API.cpp
+++ b/intern/mantaflow/intern/manta_fluid_API.cpp
@@ -160,7 +160,7 @@ extern "C" void smoke_export(FLUID *smoke, float *dt, float *dx, float **dens, f
 	*dx = 1; //dummy value, not needed for smoke
 }
 
-extern "C" void liquid_export(FLUID *liquid, float **phi, float **pp, float **pvel, float **ppSnd, float **pvelSnd, int **ptypeSnd, int **plifeSnd)
+extern "C" void liquid_export(FLUID *liquid, float **phi, float **pp, float **pvel, float **ppSnd, float **pvelSnd, int **plifeSnd)
 {
 	if (phi)
 		*phi = liquid->getPhi();
@@ -172,8 +172,6 @@ extern "C" void liquid_export(FLUID *liquid, float **phi, float **pp, float **pv
 		*ppSnd = liquid->getSndParticleData();
 	if (pvelSnd)
 		*pvelSnd = liquid->getSndParticleVelocity();
-	if (ptypeSnd)
-		*ptypeSnd = liquid->getSndParticleType();
 	if (plifeSnd)
 		*plifeSnd = liquid->getSndParticleLife();
 }
@@ -780,11 +778,6 @@ extern "C" float liquid_get_snd_particle_velocity_z_at(FLUID *liquid, int i)
 	return liquid->getSndParticleVelocityZAt(i);
 }
 
-extern "C" int liquid_get_snd_particle_type_at(FLUID *liquid, int i)
-{
-	return liquid->getSndParticleTypeAt(i);
-}
-
 extern "C" void liquid_update_mesh_data(FLUID *liquid, char* filename)
 {
 	liquid->updateMeshData(filename);
@@ -817,11 +810,6 @@ extern "C" void liquid_set_snd_particle_velocity(FLUID* liquid, float* buffer, i
 	liquid->setSndParticleVelocity(buffer, numParts);
 }
 
-extern "C" void liquid_set_snd_particle_type(FLUID* liquid, int* buffer, int numParts)
-{
-	liquid->setSndParticleType(buffer, numParts);
-}
-
 extern "C" void liquid_set_snd_particle_life(FLUID* liquid, int* buffer, int numParts)
 {
 	liquid->setSndParticleLife(buffer, numParts);
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index 31652adab02..85cf0ef586d 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -169,7 +169,6 @@ const std::string fluid_alloc_sndparts_low = "\n\
 mantaMsg('Allocating snd parts low')\n\
 ppSnd_s$ID$     = s$ID$.create(BasicParticleSystem)\n\
 pVelSnd_pp$ID$  = ppSnd_s$ID$.create(PdataVec3)\n\
-pTypeSnd_pp$ID$ = ppSnd_s$ID$.create(PdataInt)\n\
 pLifeSnd_pp$ID$ = ppSnd_s$ID$.create(PdataInt)\n";
 
 //////////////////////////////////////////////////////////////////////
@@ -248,7 +247,6 @@ const std::string fluid_delete_sndparts_low = "\n\
 mantaMsg('Deleting snd parts low')\n\
 if 'ppSnd_s$ID$'     in globals() : del ppSnd_s$ID$\n\
 if 'pVelSnd_pp$ID$'  in globals() : del pVelSnd_pp$ID$\n\
-if 'pTypeSnd_pp$ID$' in globals() : del pTypeSnd_pp$ID$\n\
 if 'pLifeSnd_pp$ID$' in globals() : del pLifeSnd_pp$ID$\n";
 
 const std::string fluid_multigrid_cleanup_low = "\n\
@@ -300,7 +298,6 @@ const std::string fluid_sndparts_import_low = "\n\
 def load_fluid_sndparts_data_low_$ID$(path):\n\
     ppSnd_s$ID$.load(path + '_ppSnd.uni')\n\
     pVelSnd_pp$ID$.load(path + '_pVelSnd.uni')\n\
-    pTypeSnd_pp$ID$.load(path + '_pTypeSnd.uni')\n\
     pLifeSnd_pp$ID$.load(path + '_pLifeSnd.uni')\n";
 
 const std::string fluid_obstacle_export_low = "\n\
@@ -333,7 +330,6 @@ const std::string fluid_sndparts_export_low = "\n\
 def save_fluid_sndparts_data_low_$ID$(path):\n\
     ppSnd_s$ID$.save(path + '_ppSnd.uni')\n\
     pVelSnd_pp$ID$.save(path + '_pVelSnd.uni')\n\
-    pTypeSnd_pp$ID$.save(path + '_pTypeSnd.uni')\n\
     pLifeSnd_pp$ID$.save(path + '_pLifeSnd.uni')\n";
 
 //////////////////////////////////////////////////////////////////////
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 0a2bd19baac..e6b68253295 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -599,7 +599,7 @@ static int ptcache_smoke_write(PTCacheFile *pf, void *smoke_v)
 	if (sds->fluid) {
 		size_t res = sds->res[0]*sds->res[1]*sds->res[2];
 		float dt, dx, *dens, *react, *fuel, *flame, *heat, *vx, *vy, *vz, *r, *g, *b, *phi, *pp, *pvel, *ppSnd, *pvelSnd;
-		int *obstacles, *ptypeSnd, *plifeSnd, numParts = 0, numPartsSnd = 0;
+		int *obstacles, *plifeSnd, numParts = 0, numPartsSnd = 0;
 		unsigned int in_len = sizeof(float)*(unsigned int)res;
 		unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len) * 4, "pointcache_lzo_buffer");
 		//int mod

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list