[Bf-blender-cvs] [91233bda023] fluid-mantaflow: clean up and fixed some warnings

Sebastián Barschkis noreply at git.blender.org
Mon Apr 2 14:52:10 CEST 2018


Commit: 91233bda0235eb9218a02483cb21d1ada6bb3d53
Author: Sebastián Barschkis
Date:   Mon Apr 2 14:52:01 2018 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB91233bda0235eb9218a02483cb21d1ada6bb3d53

clean up and fixed some warnings

fixes broken linux build

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

M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/strings/liquid_script.h
M	intern/mantaflow/intern/strings/shared_script.h
M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	source/blender/blenkernel/BKE_smoke.h
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenkernel/intern/smoke.c
M	source/blender/editors/physics/physics_fluid.c

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

diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index dbe3fbedf9c..8e73559eb0c 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -1913,7 +1913,6 @@ void FLUID::updatePointers()
 			mColorBIn   = (float*) stringToPointer(pyObjectToString(callPythonFunction("colorIn_b" + solver_ext, func)));
 		}
 	}
-	std::cout << "FLUID::updatePointers() done" << std::endl;
 }
 
 void FLUID::updatePointersHigh()
diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index 041035dd4c4..f98c44a2bb3 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -61,7 +61,7 @@ phiIn_s$ID$      = s$ID$.create(LevelsetGrid)\n\
 phiOut_s$ID$     = s$ID$.create(LevelsetGrid)\n\
 curvature_s$ID$  = s$ID$.create(RealGrid)\n\
 \n\
-fractions_s$ID$  = 0 # s$ID$.create(MACGrid) # TODO (sebbas): disabling fractions for now - not fracwallbcs not supporting obvels yet\n\
+fractions_s$ID$  = s$ID$.create(MACGrid) # TODO (sebbas): disabling fractions for now - not fracwallbcs not supporting obvels yet\n\
 \n\
 velOld_s$ID$     = s$ID$.create(MACGrid)\n\
 velParts_s$ID$   = s$ID$.create(MACGrid)\n\
@@ -167,7 +167,7 @@ def liquid_adaptive_step_low_$ID$(framenr):\n\
     \n\
     phiOut_s$ID$.join(phiOutIn_s$ID$)\n\
     \n\
-    #updateFractions(flags=flags_s$ID$, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$, boundaryWidth=boundaryWidth_s$ID$) # TODO (sebbas): uncomment for fraction support\n\
+    updateFractions(flags=flags_s$ID$, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$, boundaryWidth=boundaryWidth_s$ID$) # TODO (sebbas): uncomment for fraction support\n\
     setObstacleFlags(flags=flags_s$ID$, phiObs=phiObs_s$ID$, phiOut=phiOut_s$ID$, fractions=fractions_s$ID$)\n\
     \n\
     # add initial velocity: set invel as source grid to ensure const vels in inflow region, sampling makes use of this\n\
@@ -201,7 +201,7 @@ def liquid_adaptive_step_high_$ID$(framenr):\n\
         \n\
         mantaMsg('xl.frame is ' + str(xl$ID$.frame))\n\
         \n\
-        fluid_adapt_time_step_high()\n\
+        fluid_adapt_time_step_high_$ID$()\n\
         mantaMsg('High step / xl$ID$.frame: ' + str(xl$ID$.frame))\n\
         liquid_step_high_$ID$()\n\
         xl$ID$.step()\n";
@@ -288,7 +288,7 @@ def liquid_step_$ID$():\n\
     extrapolateMACSimple(flags=flags_s$ID$, vel=vel_s$ID$, distance=4, phiObs=phiObs_s$ID$, intoObs=True)\n\
     setWallBcs(flags=flags_s$ID$, vel=vel_s$ID$, obvel=obvel_s$ID$ if using_obstacle_s$ID$ else 0, phiObs=phiObs_s$ID$, fractions=fractions_s$ID$)\n\
     \n\
-    extrapolateMACSimple(flags=flags_s$ID$, vel=vel_s$ID$, distance=(int(maxVel_s$ID$*1.25 )) ) # TODO (sebbas): extrapolation because of no fractions\n\
+    #extrapolateMACSimple(flags=flags_s$ID$, vel=vel_s$ID$, distance=(int(maxVel_s$ID$*1.25 )) ) # TODO (sebbas): extrapolation because of no fractions\n\
     # set source grids for resampling, used in adjustNumber!\n\
     pVel_pp$ID$.setSource(vel_s$ID$, isMAC=True)\n\
     adjustNumber(parts=pp_s$ID$, vel=vel_s$ID$, flags=flags_s$ID$, minParticles=minParticles_s$ID$, maxParticles=maxParticles_s$ID$, phi=phi_s$ID$, exclude=phiObs_s$ID$, radiusFactor=radiusFactor_s$ID$, narrowBand=adjustedNarrowBandWidth_s$ID$)\n\
@@ -329,6 +329,7 @@ def liquid_load_data_low_$ID$(path, framenr, withParticles):\n\
     mantaMsg('Liquid load data low')\n\
     framenr = fluid_cache_get_framenr_formatted_$ID$(framenr)\n\
     phi_s$ID$.load(os.path.join(path, 'phi_' + framenr +'.uni'))\n\
+    phiIn_s$ID$.load(os.path.join(path, 'phiIn_' + framenr + '.uni'))\n\
     if withParticles:\n\
         pp_s$ID$.load(os.path.join(path, 'pp_' + framenr +'.uni'))\n\
         pVel_pp$ID$.load(os.path.join(path, 'pVel_' + framenr +'.uni'))\n";
@@ -381,6 +382,7 @@ def liquid_save_data_low_$ID$(path, framenr):\n\
     mantaMsg('Liquid save data low')\n\
     framenr = fluid_cache_get_framenr_formatted_$ID$(framenr)\n\
     phi_s$ID$.save(os.path.join(path, 'phi_' + framenr +'.uni'))\n\
+    phiIn_s$ID$.save(os.path.join(path, 'phiIn_' + framenr + '.uni'))\n\
     pp_s$ID$.save(os.path.join(path, 'pp_' + framenr +'.uni'))\n\
     pVel_pp$ID$.save(os.path.join(path, 'pVel_' + framenr +'.uni'))\n";
 
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index 44e71d37d60..d32df33a2ac 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -425,7 +425,7 @@ def bake_particles_process_low_$ID$(framenr, path_data, path_particles, path_geo
     #if using_smoke_s$ID$:\n\
         # TODO (sebbas): Future update could include smoke particles (e.g. fire sparks)\n\
     if using_liquid_s$ID$:\n\
-        liquid_load_geometry_low_$ID$(path_geometry, framenr)\n\
+        #liquid_load_geometry_low_$ID$(path_geometry, framenr)\n\
         liquid_load_data_low_$ID$(path_data, framenr, True)\n\
         if framenr>1:\n\
             liquid_load_particles_low_$ID$(path_particles, framenr-1)\n\
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index 7c968b1aa31..eafd83c4b62 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -520,7 +520,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
     def poll(cls, context):
         md = context.smoke
         rd = context.scene.render
-        return md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
+        # TODO (sebbas): Merge old cache with new cache functionality
+        return False #md and (md.smoke_type == 'DOMAIN') and (rd.engine in cls.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index c81fb504d9f..2db247d3517 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -38,7 +38,7 @@ typedef float (*bresenham_callback)(float *result, float *input, int res[3], int
 struct DerivedMesh *smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm);
 
 void smoke_reallocate_fluid(struct SmokeDomainSettings *sds, int res[3], int free_old);
-void smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float dx, int res[3], int free_old);
+void smoke_reallocate_highres_fluid(struct SmokeDomainSettings *sds, float dx, int res[3]);
 void smokeModifier_free(struct SmokeModifierData *smd);
 void smokeModifier_reset(struct SmokeModifierData *smd);
 void smokeModifier_createType(struct SmokeModifierData *smd);
@@ -46,7 +46,6 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
 
 int smoke_step(struct Scene *scene, struct Object *ob, struct SmokeModifierData *smd, int frame);
 
-int smoke_make_geometry(struct Scene *scene, struct Object *ob, struct SmokeModifierData *smd, int framenr);
 float smoke_get_velocity_at(struct Object *ob, float position[3], float velocity[3]);
 int smoke_get_data_flags(struct SmokeDomainSettings *sds);
 
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index f4b71cdd5ee..a2b5b0f03a1 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -866,7 +866,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
 		VECCOPY(sds->res, ch_res);
 		sds->total_cells = ch_res[0]*ch_res[1]*ch_res[2];
 		if (sds->flags & MOD_SMOKE_HIGHRES) {
-			smoke_reallocate_highres_fluid(sds, ch_dx, ch_res, 1);
+			smoke_reallocate_highres_fluid(sds, ch_dx, ch_res);
 		}
 	}
 	
@@ -1194,7 +1194,7 @@ static int ptcache_smoke_openvdb_read(struct OpenVDBReader *reader, void *smoke_
 		sds->total_cells = cache_res[0] * cache_res[1] * cache_res[2];
 
 		if (sds->flags & MOD_SMOKE_HIGHRES) {
-			smoke_reallocate_highres_fluid(sds, cache_dx, cache_res, 1);
+			smoke_reallocate_highres_fluid(sds, cache_dx, cache_res);
 		}
 	}
 
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 49d2d8640a8..7bb7cf014b4 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -148,7 +148,7 @@ void smoke_reallocate_fluid(SmokeDomainSettings *sds, int res[3], int free_old)
 	sds->fluid = smoke_init(res, sds->smd);
 }
 
-void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[3], int free_old)
+void smoke_reallocate_highres_fluid(SmokeDomainSettings *sds, float dx, int res[3])
 {
 	sds->res_wt[0] = res[0] * (sds->amplify + 1);
 	sds->res_wt[1] = res[1] * (sds->amplify + 1);
@@ -305,7 +305,7 @@ static int smokeModifier_init(SmokeModifierData *smd, Object *ob, Scene *scene,
 
 		/* allocate highres fluid */
 		if (sds->flags & MOD_SMOKE_HIGHRES) {
-			smoke_reallocate_highres_fluid(sds, sds->dx, sds->res, 0);
+			smoke_reallocate_highres_fluid(sds, sds->dx, sds->res);
 		}
 
 		return 1;
@@ -570,7 +570,8 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
 			smd->domain->cache_volume_format = PTCACHE_FILE_PTCACHE;
 			smd->domain->cache_frame_start = 1;
 			smd->domain->cache_frame_end = 250;
-			BLI_make_file_string("/", 	BLI_path_make_safe(smd->domain->cache_directory), BKE_tempdir_base(), "");
+			BLI_path_make_safe(smd->domain->cache_directory);
+			BLI_make_file_string("/", smd->domain->cache_directory, BKE_tempdir_base(), "");
 			smd->domain->cache_flag = 0;
 
 			smd->domain->display_thickness = 1.0f;
@@ -2208,7 +2209,7 @@ static void adjustDomainResolution(SmokeDomainSettings *sds, int new_shift[3], E
 		/* allocate new fluid data */
 		smoke_reallocate_fluid(sds, res, 0);
 		if (sds->flags & MOD_SMOKE_HIGHRES) {
-			smoke_reallocate_highres_fluid(sds, sds->dx, res, 0);
+			smoke_reallocate_highres_fluid(sds, sds->dx, res);
 		}
 
 		/* copy values from old fluid to new */
@@ -2641,9 +2642,6 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 
 	floa

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list