[Bf-blender-cvs] [7d1c73f5baf] fluid-mantaflow: legacy code cleanup
Sebastián Barschkis
noreply at git.blender.org
Mon May 7 17:30:10 CEST 2018
Commit: 7d1c73f5bafa3056d260e5b66c5a12cfac2a413e
Author: Sebastián Barschkis
Date: Mon May 7 12:20:58 2018 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB7d1c73f5bafa3056d260e5b66c5a12cfac2a413e
legacy code cleanup
mostly from manta script export (which needs to be refactored later) and from pointcache (which needs to go altogether)
===================================================================
M intern/mantaflow/intern/FLUID.cpp
M intern/mantaflow/intern/FLUID.h
M intern/mantaflow/intern/strings/shared_script.h
===================================================================
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index cbd5f69f8cc..53a4783d305 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -251,10 +251,6 @@ void FLUID::initDomain(SmokeModifierData *smd)
+ fluid_file_export
+ fluid_save_data
+ fluid_load_data
- + fluid_obstacle_export
- + fluid_guiding_export
- + fluid_invel_export
- + fluid_sndparts_export
+ fluid_adapt_time_step
+ fluid_adaptive_time_stepping;
std::string finalString = parseScript(tmpString, smd);
@@ -968,12 +964,6 @@ void FLUID::exportSmokeScript(SmokeModifierData *smd)
}
manta_script += smoke_load_data;
- if (obstacle)
- manta_script += fluid_obstacle_import_low;
- if (guiding)
- manta_script += fluid_guiding_import_low;
- if (invel)
- manta_script += fluid_invel_import_low;
if (highres)
manta_script += smoke_load_noise;
@@ -1459,14 +1449,6 @@ void FLUID::exportLiquidScript(SmokeModifierData *smd)
manta_script += liquid_load_flip;
// if (highres)
// manta_script += liquid_load_data_high;
- if (obstacle)
- manta_script += fluid_obstacle_import_low;
- if (guiding)
- manta_script += fluid_guiding_import_low;
- if (invel)
- manta_script += fluid_invel_import_low;
- if (drops || bubble || floater || tracer)
- manta_script += fluid_sndparts_import_low;
manta_script += liquid_pre_step;
manta_script += liquid_post_step;
@@ -2126,42 +2108,6 @@ static std::string escape_slashes(std::string const& s) {
return Result;
}
-void FLUID::saveMesh(char *filename, int framenr)
-{
- std::string path(filename);
- std::vector<std::string> pythonCommands;
- std::ostringstream ss;
-
- ss << "liquid_save_mesh_" << mCurrentID << "(\"" << escape_slashes(path) << "\")\r\n";
- pythonCommands.push_back(ss.str());
-
- runPythonString(pythonCommands);
-}
-
-void FLUID::saveParticles(char* filename)
-{
- std::string path(filename);
- std::vector<std::string> pythonCommands;
- std::ostringstream ss;
-
- ss << "fluid_save_particles_" << mCurrentID << "(\"" << escape_slashes(path) << "\")\r\n";
- pythonCommands.push_back(ss.str());
-
- runPythonString(pythonCommands);
-}
-
-void FLUID::saveParticleVelocities(char* filename)
-{
- std::string path(filename);
- std::vector<std::string> pythonCommands;
- std::ostringstream ss;
-
- ss << "save_particles_velocities_" << mCurrentID << "(\"" << escape_slashes(path) << "\")\r\n";
- pythonCommands.push_back(ss.str());
-
- runPythonString(pythonCommands);
-}
-
void FLUID::saveFluidObstacleData(char *pathname)
{
std::string path(pathname);
@@ -2258,27 +2204,5 @@ void FLUID::saveLiquidDataHigh(char *pathname)
runPythonString(pythonCommands);
}
-void FLUID::loadLiquidData(char *pathname)
-{
- std::string path(pathname);
- std::vector<std::string> pythonCommands;
- std::ostringstream ss;
-
- ss << "load_liquid_data_low_" << mCurrentID << "(r'" << path << "')";
- pythonCommands.push_back(ss.str());
-
- runPythonString(pythonCommands);
-}
-
-void FLUID::loadLiquidDataHigh(char *pathname)
-{
- std::string path(pathname);
- std::vector<std::string> pythonCommands;
- std::ostringstream ss;
-
- ss << "load_liquid_data_high_" << mCurrentID << "(r'" << path << "')";
- pythonCommands.push_back(ss.str());
- runPythonString(pythonCommands);
-}
diff --git a/intern/mantaflow/intern/FLUID.h b/intern/mantaflow/intern/FLUID.h
index 18b80311d51..47b0be5e4ea 100644
--- a/intern/mantaflow/intern/FLUID.h
+++ b/intern/mantaflow/intern/FLUID.h
@@ -108,18 +108,9 @@ public:
void saveSmokeDataHigh(char *pathname);
// Write files for liquids
- void saveMesh(char *filename, int framenr);
void saveLiquidData(char *pathname);
void saveLiquidDataHigh(char *pathname);
- // Write files for particles
- void saveParticles(char* filename);
- void saveParticleVelocities(char* filename);
-
- // Load files for liquids
- void loadLiquidData(char *pathname);
- void loadLiquidDataHigh(char *pathname);
-
// Smoke getters
inline size_t getTotalCells() { return mTotalCells; }
inline size_t getTotalCellsHigh() { return mTotalCellsHigh; }
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index 568d11fbf46..57a18edc511 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -430,74 +430,6 @@ def fluid_load_data_$ID$(path, framenr, file_format):\n\
mantaMsg('Fluid load data')\n\
fluid_file_import_s$ID$(dict=fluid_data_dict_s$ID$, path=path, framenr=framenr, file_format=file_format)\n";
-/* BEGIN TODO (sebbas): refactor */
-
-const std::string fluid_obstacle_import_low = "\n\
-def load_fluid_obstacle_data_low_$ID$(path):\n\
- numObs_s$ID$.load(path + '_numObs.uni')\n\
- phiObsIn_s$ID$.load(path + '_phiObsIn.uni')\n\
- obvel_s$ID$.load(path + '_obvel.uni')\n\
- x_obvel_s$ID$.load(path + '_x_obvel.uni')\n\
- y_obvel_s$ID$.load(path + '_y_obvel.uni')\n\
- z_obvel_s$ID$.load(path + '_z_obvel.uni')\n";
-
-const std::string fluid_guiding_import_low = "\n\
-def load_fluid_guiding_data_low_$ID$(path):\n\
- numGuides_s$ID$.load(path + '_numGuides.uni')\n\
- phiGuideIn_s$ID$.load(path + '_phiGuideIn.uni')\n\
- guidevel_s$ID$.load(path + '_guidevel.uni')\n\
- x_guidevel_s$ID$.load(path + '_x_guidevel.uni')\n\
- y_guidevel_s$ID$.load(path + '_y_guidevel.uni')\n\
- z_guidevel_s$ID$.load(path + '_z_guidevel.uni')\n\
- weightGuide_s$ID$.load(path + '_weightGuide.uni')\n";
-
-const std::string fluid_invel_import_low = "\n\
-def load_fluid_invel_data_low_$ID$(path):\n\
- invel_s$ID$.load(path + '_invel.uni')\n\
- x_invel_s$ID$.load(path + '_x_invel.uni')\n\
- y_invel_s$ID$.load(path + '_y_invel.uni')\n\
- z_invel_s$ID$.load(path + '_z_invel.uni')\n";
-
-const std::string fluid_sndparts_import_low = "\n\
-def load_fluid_sndparts_data_low_$ID$(path):\n\
- ppSnd_sp$ID$.load(path + '_ppSnd.uni')\n\
- pVelSnd_pp$ID$.load(path + '_pVelSnd.uni')\n\
- pLifeSnd_pp$ID$.load(path + '_pLifeSnd.uni')\n";
-
-const std::string fluid_obstacle_export = "\n\
-def save_fluid_obstacle_data_low_$ID$(path):\n\
- numObs_s$ID$.save(path + '_numObs.uni')\n\
- phiObsIn_s$ID$.save(path + '_phiObsIn.uni')\n\
- obvel_s$ID$.save(path + '_obvel.uni')\n\
- x_obvel_s$ID$.save(path + '_x_obvel.uni')\n\
- y_obvel_s$ID$.save(path + '_y_obvel.uni')\n\
- z_obvel_s$ID$.save(path + '_z_obvel.uni')\n";
-
-const std::string fluid_guiding_export = "\n\
-def save_fluid_guiding_data_low_$ID$(path):\n\
- numGuides_s$ID$.save(path + '_numGuides.uni')\n\
- phiGuideIn_s$ID$.save(path + '_phiGuideIn.uni')\n\
- guidevel_s$ID$.save(path + '_guidevel.uni')\n\
- x_guidevel_s$ID$.save(path + '_x_guidevel.uni')\n\
- y_guidevel_s$ID$.save(path + '_y_guidevel.uni')\n\
- z_guidevel_s$ID$.save(path + '_z_guidevel.uni')\n\
- weightGuide_s$ID$.save(path + '_weightGuide.uni')\n";
-
-const std::string fluid_invel_export = "\n\
-def save_fluid_invel_data_low_$ID$(path):\n\
- invel_s$ID$.save(path + '_invel.uni')\n\
- x_invel_s$ID$.save(path + '_x_invel.uni')\n\
- y_invel_s$ID$.save(path + '_y_invel.uni')\n\
- z_invel_s$ID$.save(path + '_z_invel.uni')\n";
-
-const std::string fluid_sndparts_export = "\n\
-def save_fluid_sndparts_data_low_$ID$(path):\n\
- ppSnd_sp$ID$.save(path + '_ppSnd.uni')\n\
- pVelSnd_pp$ID$.save(path + '_pVelSnd.uni')\n\
- pLifeSnd_pp$ID$.save(path + '_pLifeSnd.uni')\n";
-
-/* END TODO (sebbas): refactor */
-
//////////////////////////////////////////////////////////////////////
// EXPORT
//////////////////////////////////////////////////////////////////////
More information about the Bf-blender-cvs
mailing list