[Bf-blender-cvs] [01ec151] soc-2014-fluid: commented parts and debug msgs removed in rest of files
Roman Pogribnyi
noreply at git.blender.org
Mon Aug 18 16:52:19 CEST 2014
Commit: 01ec151a0752be680d380105393c3de34058a191
Author: Roman Pogribnyi
Date: Mon Aug 18 15:22:59 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rB01ec151a0752be680d380105393c3de34058a191
commented parts and debug msgs removed in rest of files
===================================================================
M intern/smoke/intern/MANTA.cpp
M intern/smoke/intern/MANTA.h
M intern/smoke/intern/smoke_API.cpp
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index 97f2393..91e02ba 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -1,7 +1,5 @@
#include "MANTA.h"
#include "WTURBULENCE.h"
-//#include "../../../source/blender/blenlib/BLI_fileops.h"
-//#include "../../../source/blender/python/manta_pp/pwrapper/pymain.cpp"
void runMantaScript(vector<string>& args);//defined in manta_pp/pwrapper/pymain.cpp
@@ -11,10 +9,8 @@ extern "C" bool manta_check_grid_size(struct FLUID_3D *fluid, int dimX, int dimY
if (!(dimX == fluid->xRes() && dimY == fluid->yRes() && dimZ == fluid->zRes())) {
for (int cnt(0); cnt < fluid->_totalCells; cnt++)
fluid->_density[cnt] = 0.0f;
- cout<<"lowresgrid res not ok"<<endl;
return false;
}
- cout<<"lowresgrid res ok"<<endl;
return true;
}
@@ -24,10 +20,8 @@ extern "C" bool manta_check_wavelets_size(struct WTURBULENCE *wt, int dimX, int
if (!(dimX == wt->_xResBig && dimY == wt->_yResBig && dimZ == wt->_zResBig)) {
for (int cnt(0); cnt < wt->_totalCellsBig; cnt++)
wt->_densityBig[cnt] = 0.0f;
- cout<<"highresgrid res not ok"<<endl;
return false;
}
- cout<<"highresgrid res ok"<<endl;
return true;
}
@@ -38,7 +32,7 @@ void read_rotated_grid(gzFile gzf, float *data, int size_x, int size_y, int size
// data = (float*)malloc(sizeof(float) * size_x * size_y * size_z);
gzread(gzf, temp_data, sizeof(float)* size_x * size_y * size_z);
for (int cnt_x(0); cnt_x < size_x; ++cnt_x)
- {
+{
for (int cnt_y(0); cnt_y < size_y; ++cnt_y)
{
for (int cnt_z(0); cnt_z < size_z; ++cnt_z)
@@ -47,13 +41,11 @@ void read_rotated_grid(gzFile gzf, float *data, int size_x, int size_y, int size
}
}
}
- cout<<"rotated grid read"<<endl;
}
void wavelets_add_lowres_density(SmokeDomainSettings *sds)
{
assert(sds != NULL);
- cout<<"adding lowres density to wavelets"<<endl;
for (int cnt_x(0); cnt_x < sds->wt->_xResBig; ++cnt_x)
{
for (int cnt_y(0); cnt_y < sds->wt->_yResBig; ++cnt_y)
@@ -90,13 +82,11 @@ void wavelets_add_lowres_density(SmokeDomainSettings *sds)
}
}
}
- cout<<"done"<<endl;
}
//PR need SMD data here for wavelets
extern "C" int read_mantaflow_sim(struct SmokeDomainSettings *sds, char *name, bool reading_wavelets)
{
- cout<<"reading mantaflow sim from file:"<<name<<endl;
/*! legacy headers for reading old files */
typedef struct {
int dimX, dimY, dimZ;
@@ -168,24 +158,17 @@ extern "C" int read_mantaflow_sim(struct SmokeDomainSettings *sds, char *name, b
gzread(gzf, &head, sizeof(UniHeader));
/* actual grid read */
if ( ! reading_wavelets){
- cout<<"lowres"<<endl;
if (!manta_check_grid_size(sds->fluid, head.dimX, head.dimY, head.dimZ)) return 0;
/*Y and Z axes are swapped in manta and blender*/
-// read_rotated_grid(gzf,sds->fluid->_density,head.dimX,head.dimY,head.dimZ);
- cout<<"lowres2"<<endl;
gzread(gzf,sds->fluid->_density, sizeof(float)*head.dimX*head.dimY*head.dimZ);
}
else{
if (!manta_check_wavelets_size(sds->wt, head.dimX, head.dimY, head.dimZ)) return 0;
/*Y and Z axes are swapped in manta and blender*/
- cout<<"highres"<<endl;
gzread(gzf,sds->wt->_densityBig, sizeof(float)*head.dimX*head.dimY*head.dimZ);
gzread(gzf,sds->wt->_densityBigOld, sizeof(float)*head.dimX*head.dimY*head.dimZ);
- cout<<"highres2"<<endl;
-// read_rotated_grid(gzf,sds->wt->_densityBig,head.dimX,head.dimY,head.dimZ);
// wavelets_add_lowres_density(sds);
-// read_rotated_grid(gzf,sds->wt->_densityBigOld,head.dimX,head.dimY,head.dimZ);
}
}
gzclose(gzf);
@@ -283,10 +266,8 @@ void manta_cache_path(char *filepath)
//void BLI_dir_create_recursive(const char *filepath);
void create_manta_folder()
{
- //cout<<"PR BLENDER FILES" << BLI_get_folder(BLENDER_USER_DATAFILES, NULL)<<endl;
char* filepath=NULL;
manta_cache_path(filepath);
- cout<<"PR_filepath" <<filepath<<endl;
//BLI_dir_create_recursive(filepath);
}
@@ -327,7 +308,6 @@ void run_manta_scene(Scene *s, SmokeModifierData *smd)
std::string py_string_1 = py_string_0.append(")\0");
// std::string py_string_1 = string("sim_step()\0");
PyRun_SimpleString(py_string_1.c_str());
- cout<< "done"<<manta_sim_running<<endl;
// frame_num ++;
}
PyGILState_Release(gilstate);
diff --git a/intern/smoke/intern/MANTA.h b/intern/smoke/intern/MANTA.h
index 22cda57..247f3db 100644
--- a/intern/smoke/intern/MANTA.h
+++ b/intern/smoke/intern/MANTA.h
@@ -12,12 +12,11 @@
#include <Python.h>
#include <vector>
#include "../../../source/blender/blenlib/BLI_path_util.h"
-//#include "../../../source/blender/blenlib/BLI_fileops.h"
-//#include "../../../source/blender/python/manta_pp/pwrapper/pymain.cpp"
void export_force_fields(int size_x, int size_y, int size_z, float *f_x, float*f_y, float*f_z);/*defined in pymain.cpp*/
extern "C" void manta_write_effectors(struct Scene *s, struct SmokeModifierData *smd); /*defined in smoke_api.cpp*/
+/*for passing to detached thread*/
struct manta_arg_struct {
Scene s;
SmokeModifierData smd;
@@ -51,7 +50,6 @@ void manta_cache_path(char *filepath);
static bool manta_sim_running=true;
-//void BLI_dir_create_recursive(const char *filepath);
void create_manta_folder();
void *run_manta_scene_thread(void *threadid);
diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp
index 5cce068..3f1c1e8 100644
--- a/intern/smoke/intern/smoke_API.cpp
+++ b/intern/smoke/intern/smoke_API.cpp
@@ -508,15 +508,6 @@ extern "C" int smoke_mantaflow_read(struct SmokeDomainSettings *sds, char* name,
extern "C" void smoke_mantaflow_write_scene_file(struct Scene *s, struct SmokeModifierData *smd)
{
-// update_effectors(s, NULL, smd->domain, 0.1f);
-// FLUID_3D *fluid = smd->domain->fluid;
-// int size_x = fluid->xRes();
-// int size_y = fluid->yRes();
-// int size_z = fluid->zRes();
-// float *force_x = smoke_get_force_x(fluid);
-// float *force_y = smoke_get_force_y(fluid);
-// float *force_z = smoke_get_force_z(fluid);
-// export_force_fields(size_x, size_y, size_z, force_x, force_y, force_z);
generate_manta_sim_file(s, smd);
}
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 67f3023..fb91202 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2767,9 +2767,7 @@ static void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object *
return;
}
if (framenr == startframe && smd->domain->flags & MOD_SMOKE_USE_MANTA && smd->domain->fluid){
- printf("smoke.c writing scene\n");
smoke_mantaflow_write_scene_file(scene, smd);
- printf("smoke.c writing scene done\n");
}
/* try to read from cache */
if (BKE_ptcache_read(&pid, (float)framenr) == PTCACHE_READ_EXACT) {
@@ -2802,14 +2800,10 @@ static void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object *
// DG: interesting commenting this line + deactivating loading of noise files
if(framenr != startframe && smd->domain->flags & MOD_SMOKE_USE_MANTA) /*load manta sim data into fluid object*/
{
- printf("smoke.c smoke step\n");
smoke_mantaflow_sim_step(scene,smd);
- printf("smoke.c smoke step done\n");
const char *density_name_format = "./den%04d.uni";
const char *wavelets_name_format = "./densityXL_%04d.uni";
char buff[100];
-// if(smd->domain->manta_start_frame > scene->r.cfra)
-// return;
sprintf(buff, density_name_format, scene->r.cfra);
bool read_density = smoke_mantaflow_read(smd->domain, buff, 0);
bool read_wavelets = 1;
@@ -2819,7 +2813,6 @@ static void smokeModifier_process(SmokeModifierData *smd, Scene *scene, Object *
sprintf(buff, wavelets_name_format, scene->r.cfra);
read_wavelets = smoke_mantaflow_read(smd->domain, buff, 1);
}
- printf("smoke.c smoke read done\n");
}else{
if (framenr != startframe)
{
More information about the Bf-blender-cvs
mailing list