[Bf-blender-cvs] [5e00f7b] fluid-mantaflow: implemented flow behavior geometry mode. works with liquids and also with smoke.

Sebastián Barschkis noreply at git.blender.org
Mon Aug 8 15:52:49 CEST 2016


Commit: 5e00f7b9c0a15bed25ee43d7928fab952db09082
Author: Sebastián Barschkis
Date:   Sun Aug 7 23:58:21 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB5e00f7b9c0a15bed25ee43d7928fab952db09082

implemented flow behavior geometry mode. works with liquids and also with smoke.

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

M	intern/mantaflow/intern/strings/liquid_script.h
M	source/blender/blenkernel/intern/smoke.c

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

diff --git a/intern/mantaflow/intern/strings/liquid_script.h b/intern/mantaflow/intern/strings/liquid_script.h
index 7cf8a47..aced190 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -176,7 +176,7 @@ def liquid_step():\n\
         adjustNumber( parts=pp, vel=vel, flags=flags, minParticles=1*minParticles, maxParticles=2*minParticles, phi=phi )\n\
     \n\
     # reset inflow grid\n\
-    phiInit.initFromFlags(flags)\n";
+    phiInit.setConst(0.5)\n";
 
 //////////////////////////////////////////////////////////////////////
 // IMPORT EXPORT GRIDS, MESHES, PARTICLESYSTEM
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 5c91a41..a69cafe 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2212,7 +2212,7 @@ BLI_INLINE void apply_outflow_fields(int index, float *density, float *heat, flo
 BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value, float inflow_value, int index, float *density, float *heat, float *fuel, float *react, float *color_r, float *color_g, float *color_b, float *phi)
 {
 	/* no inflow enabled. just return */
-	if (!(sfs->flags & MOD_SMOKE_FLOW_USE_INFLOW)) {
+	if (!(sfs->flags & MOD_SMOKE_FLOW_USE_INFLOW) && sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_INFLOW) {
 		return;
 	}
 	
@@ -2554,7 +2554,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 							if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_OUTFLOW) { // outflow
 								apply_outflow_fields(d_index, density, heat, fuel, react, color_r, color_g, color_b, phi, flags);
 							}
-							else if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_INFLOW) { // inflow
+							else if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_INFLOW || (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_GEOMETRY && smd2->time == 2)) { // inflow
 								apply_inflow_fields(sfs, emission_map[e_index], inflow_map[e_index], d_index, density, heat, fuel, react, color_r, color_g, color_b, phi);
 
 								/* initial velocity */
@@ -2646,7 +2646,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 													apply_outflow_fields(index_big, bigdensity, NULL, bigfuel, bigreact, bigcolor_r, bigcolor_g, bigcolor_b, bigphi, bigflags);
 												}
 											}
-											else if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_INFLOW) { // inflow
+											else if (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_INFLOW || (sfs->behavior == MOD_SMOKE_FLOW_BEHAVIOR_GEOMETRY && smd2->time == 2)) { // inflow
 												// TODO (sebbas) inflow map highres?
 												apply_inflow_fields(sfs, interpolated_value, inflow_map_high[index_big], index_big, bigdensity, NULL, bigfuel, bigreact, bigcolor_r, bigcolor_g, bigcolor_b, bigphi);
 											}




More information about the Bf-blender-cvs mailing list