[Bf-blender-cvs] [b1acc10] soc-2014-fluid: not initializing density fields
Roman Pogribnyi
noreply at git.blender.org
Tue Nov 11 23:43:13 CET 2014
Commit: b1acc10d8b4c339436a11a79abc88edf3bdfe5a5
Author: Roman Pogribnyi
Date: Wed Nov 5 21:26:12 2014 +0100
Branches: soc-2014-fluid
https://developer.blender.org/rBb1acc10d8b4c339436a11a79abc88edf3bdfe5a5
not initializing density fields
===================================================================
M intern/smoke/extern/smoke_API.h
M intern/smoke/intern/FLUID_3D.cpp
M intern/smoke/intern/MANTA.cpp
M intern/smoke/intern/WTURBULENCE.cpp
M source/blender/blenkernel/intern/smoke.c
M source/blender/editors/physics/physics_fluid.c
M source/blender/makesrna/intern/rna_smoke.c
===================================================================
diff --git a/intern/smoke/extern/smoke_API.h b/intern/smoke/extern/smoke_API.h
index 5d921f8..c4fec32 100644
--- a/intern/smoke/extern/smoke_API.h
+++ b/intern/smoke/extern/smoke_API.h
@@ -110,7 +110,6 @@ void smoke_ensure_colors(struct FLUID_3D *fluid, struct WTURBULENCE *wt, float i
/*Mantaflow functions*/
int smoke_mantaflow_read(struct SmokeDomainSettings *sds, char* name, bool with_wavelets); //1:success, 0: no file,error
-//void smoke_mantaflow_sim_step(struct Scene *scene, struct SmokeModifierData *smd);
void smoke_mantaflow_stop_sim(struct Manta_API *fluid);
void manta_write_effectors(struct FLUID_3D *fluid);
void manta_update_effectors(struct Scene *scene, struct Object *ob,struct SmokeDomainSettings *sds, float dt);
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp
index c7e03d6..2b286c8 100644
--- a/intern/smoke/intern/FLUID_3D.cpp
+++ b/intern/smoke/intern/FLUID_3D.cpp
@@ -1696,7 +1696,7 @@ _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f)
_xForce = new float[_totalCells];
_yForce = new float[_totalCells];
_zForce = new float[_totalCells];
- _density = new float[_totalCells];
+ _density = NULL;
_densityOld = new float[_totalCells];
_obstacles = new unsigned char[_totalCells]; // set 0 at end of step
@@ -1710,7 +1710,6 @@ _xRes(res[0]), _yRes(res[1]), _zRes(res[2]), _res(0.0f)
for (int x = 0; x < _totalCells; x++)
{
- _density[x] = 0.0f;
_densityOld[x] = 0.0f;
_xVelocity[x] = 0.0f;
_yVelocity[x] = 0.0f;
diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index 72d3695..63579bc 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -692,7 +692,7 @@ Manta_API::Manta_API(int *res, float dx, float dtdef, int init_heat, int init_fi
// _colloPrev = 1; // default value
// sds->fluid = this;
- generate_manta_sim_file_lowRes(sds->smd);
+// generate_manta_sim_file_lowRes(sds->smd);
}
Manta_API::~Manta_API()
diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp
index 563ed23..11ab1b1 100644
--- a/intern/smoke/intern/WTURBULENCE.cpp
+++ b/intern/smoke/intern/WTURBULENCE.cpp
@@ -1245,11 +1245,10 @@ WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int no
// allocate high resolution density field
_totalStepsBig = 0;
- _densityBig = new float[_totalCellsBig];
+ _densityBig = NULL;
_densityBigOld = new float[_totalCellsBig];
for(int i = 0; i < _totalCellsBig; i++) {
- _densityBig[i] =
_densityBigOld[i] = 0.;
}
@@ -1293,6 +1292,7 @@ WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int no
setNoise(noisetype, noisefile_path);
sds->smd->domain->wt = this;
Manta_API::generate_manta_sim_file_highRes(sds->smd);
+ Manta_API::updateHighResPointers(this);
}
/// destructor
WTURBULENCE::~WTURBULENCE()
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 472ed24..cca9b01 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2620,12 +2620,8 @@ static void step(Scene *scene, Object *ob, SmokeModifierData *smd, DerivedMesh *
if (sds->total_cells > 1) {
update_effectors(scene, ob, sds, dtSubdiv); // DG TODO? problem --> uses forces instead of velocity, need to check how they need to be changed with variable dt
- if (sds->flags & MOD_SMOKE_USE_MANTA){
- smoke_mantaflow_sim_step(sds->fluid);
- }
- else{
smoke_step(sds->fluid, gravity, dtSubdiv);
- }
+
}
}
}
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 574d4fb..e3a1287 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -1142,7 +1142,6 @@ static int manta_make_file_invoke(bContext *C, wmOperator *op, const wmEvent *UN
SmokeModifierData *smd;
Object * smokeDomain = CTX_data_active_object(C);
smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, eModifierType_Smoke);
- smoke_mantaflow_write_scene_file(smd);
/* return OPERATOR_CANCELLED;*/
return OPERATOR_FINISHED;
@@ -1163,8 +1162,7 @@ static int manta_make_file_exec(bContext *C, wmOperator *op)
}
// smd->domain->fluid = smoke_init(smd->domain->res, 0.1f, 0.1f, 0,0,0);
}
- smoke_mantaflow_write_scene_file(smd);
-
+
/* return OPERATOR_CANCELLED;*/
return OPERATOR_FINISHED;
@@ -1190,7 +1188,6 @@ static int manta_sim_step_invoke(bContext *C, wmOperator *op, const wmEvent *UNU
SmokeModifierData *smd;
Object * smokeDomain = CTX_data_active_object(C);
smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, eModifierType_Smoke);
- smoke_mantaflow_sim_step(smd->domain->fluid);
/* return OPERATOR_CANCELLED;*/
return OPERATOR_FINISHED;
@@ -1202,7 +1199,6 @@ static int manta_sim_step_exec(bContext *C, wmOperator *op)
SmokeModifierData *smd;
Object * smokeDomain = CTX_data_active_object(C);
smd = (SmokeModifierData *)modifiers_findByType(smokeDomain, eModifierType_Smoke);
- smoke_mantaflow_sim_step(smd->domain->fluid);
/* return OPERATOR_CANCELLED;*/
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index d2e985d..80ac932 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -100,8 +100,6 @@ static void rna_Smoke_reset_dependency(Main *bmain, Scene *scene, PointerRNA *pt
static void rna_Smoke_manta_write_settings(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data;
- if (settings->flags & MOD_SMOKE_USE_MANTA)
- smoke_mantaflow_write_scene_file(settings->smd);
rna_Smoke_reset(bmain,scene,ptr);
}
More information about the Bf-blender-cvs
mailing list