[Bf-blender-cvs] [836db6c] fluid-mantaflow: fixed domain switching - now using flags correctly

Sebastián Barschkis noreply at git.blender.org
Wed Jun 8 00:27:54 CEST 2016


Commit: 836db6c990469158f15192279fb7f0a1c034201a
Author: Sebastián Barschkis
Date:   Tue Jun 7 00:45:26 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB836db6c990469158f15192279fb7f0a1c034201a

fixed domain switching - now using flags correctly

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

M	intern/mantaflow/intern/SMOKE.cpp
M	source/blender/blenkernel/intern/smoke.c

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

diff --git a/intern/mantaflow/intern/SMOKE.cpp b/intern/mantaflow/intern/SMOKE.cpp
index 185d47f..5ac180a 100644
--- a/intern/mantaflow/intern/SMOKE.cpp
+++ b/intern/mantaflow/intern/SMOKE.cpp
@@ -56,8 +56,8 @@ SMOKE::SMOKE(int *res, SmokeModifierData *smd)
 	mUsingFire    = smd->domain->active_fields & SM_ACTIVE_FIRE;
 	mUsingColors  = smd->domain->active_fields & SM_ACTIVE_COLORS;
 	mUsingHighRes = smd->domain->flags & MOD_SMOKE_HIGHRES;
-	mUsingLiquid  = true; // TODO Hardcoded for liquid testing (no gui yet)
-	mUsingSmoke   = false;
+	mUsingLiquid  = smd->domain->type == MOD_SMOKE_DOMAIN_TYPE_LIQUID;
+	mUsingSmoke   = smd->domain->type == MOD_SMOKE_DOMAIN_TYPE_GAS;
 	
 	// Make sure that string vector does not contain any previous commands
 	mCommands.clear();
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 93d83ac..63e3587 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2357,7 +2357,7 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 			if (em->total_cells && sfs->type != MOD_SMOKE_FLOW_TYPE_OUTFLOW) {
 				/* activate liquid field. cannot be combined with anything else */
 				if (sfs->type == MOD_SMOKE_FLOW_TYPE_LIQUID) {
-					active_fields |= SM_ACTIVE_LIQUID;
+					active_fields &= SM_ACTIVE_LIQUID;
 				}
 				/* activate heat field if flow produces any heat */
 				if (sfs->temp && sfs->type != MOD_SMOKE_FLOW_TYPE_LIQUID) {
@@ -2427,6 +2427,9 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
 		/* initialize all smoke with "active_color" */
 		smoke_ensure_colors(sds->fluid, sds->smd);
 	}
+	if (active_fields & SM_ACTIVE_LIQUID) {
+		liquid_ensure_init(sds->fluid, sds->smd);
+	}
 #endif
 
 	sds->active_fields = active_fields;




More information about the Bf-blender-cvs mailing list