[Bf-blender-cvs] [93a1054] fluid-mantaflow: sanity check: make sure that domain type and flow types are valid combinations
Sebastián Barschkis
noreply at git.blender.org
Mon Aug 22 00:16:28 CEST 2016
Commit: 93a1054ecef544e7f1bc3160e7f32941fe284468
Author: Sebastián Barschkis
Date: Mon Aug 22 00:16:17 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB93a1054ecef544e7f1bc3160e7f32941fe284468
sanity check: make sure that domain type and flow types are valid combinations
===================================================================
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index e3edc4f..29a551e 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2390,6 +2390,26 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
/* init emission maps for each flow */
emaps = MEM_callocN(sizeof(struct EmissionMap) * numflowobj, "smoke_flow_maps");
+ /* Check if all flow objects are valid with respect to domain type */
+ for (flowIndex = 0; flowIndex < numflowobj; flowIndex++)
+ {
+ Object *collob = flowobjs[flowIndex];
+ SmokeModifierData *smd2 = (SmokeModifierData *)modifiers_findByType(collob, eModifierType_Smoke);
+
+ // check for initialized smoke object
+ if ((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ {
+ // we got nice flow object
+ SmokeFlowSettings *sfs = smd2->flow;
+
+ if (sds->type == MOD_SMOKE_DOMAIN_TYPE_LIQUID) {
+ if (sfs->type != MOD_SMOKE_FLOW_TYPE_LIQUID) return;
+ } else if (sds->type == MOD_SMOKE_DOMAIN_TYPE_GAS) {
+ if (sfs->type != MOD_SMOKE_FLOW_TYPE_SMOKE && sfs->type != MOD_SMOKE_FLOW_TYPE_FIRE && sfs->type != MOD_SMOKE_FLOW_TYPE_SMOKEFIRE) return;
+ }
+ }
+ }
+
/* Prepare flow emission maps */
for (flowIndex = 0; flowIndex < numflowobj; flowIndex++)
{
More information about the Bf-blender-cvs
mailing list