[Bf-blender-cvs] [8561336e2aa] fluid-mantaflow: removed flow type guard and instead made FLUID destructor less restrictive
Sebastián Barschkis
noreply at git.blender.org
Sun Mar 26 20:41:35 CEST 2017
Commit: 8561336e2aa8acafaac9a94dcea6670c89c90bd9
Author: Sebastián Barschkis
Date: Fri Mar 24 15:55:57 2017 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB8561336e2aa8acafaac9a94dcea6670c89c90bd9
removed flow type guard and instead made FLUID destructor less restrictive
required if multiple domains in viewport. domains do not know what flow objects they have inside
===================================================================
M intern/mantaflow/intern/FLUID.cpp
M source/blender/blenkernel/intern/smoke.c
===================================================================
diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 9d403c466b5..43a2c097d1e 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -377,31 +377,31 @@ FLUID::~FLUID()
{
std::cout << "FLUID: " << mCurrentID << std::endl;
- // Destruction in Python
+ // Destruction string for Python
std::string tmpString = "";
+ // Fluid
+ tmpString += fluid_delete_variables_low;
+ tmpString += fluid_delete_variables_high;
+
// Liquid
- if (mUsingLiquid) {
- tmpString += liquid_delete_variables_low;
- tmpString += liquid_delete_grids_low;
+ tmpString += liquid_delete_variables_low;
+ tmpString += liquid_delete_grids_low;
- if (mUsingHighRes) tmpString += liquid_delete_variables_high;
- if (mUsingHighRes) tmpString += liquid_delete_grids_high;
- }
+ tmpString += liquid_delete_variables_high;
+ tmpString += liquid_delete_grids_high;
// Smoke
- if (mUsingSmoke) {
- tmpString += smoke_delete_variables_low;
- tmpString += smoke_delete_grids_low;
- if (mUsingHeat) tmpString += smoke_delete_heat_low;
- if (mUsingFire) tmpString += smoke_delete_fire_low;
- if (mUsingColors) tmpString += smoke_delete_colors_low;
+ tmpString += smoke_delete_variables_low;
+ tmpString += smoke_delete_grids_low;
+ tmpString += smoke_delete_heat_low;
+ tmpString += smoke_delete_fire_low;
+ tmpString += smoke_delete_colors_low;
- if (mUsingHighRes) tmpString += smoke_delete_variables_high;
- if (mUsingHighRes) tmpString += smoke_delete_grids_high;
- if (mUsingFire && mUsingHighRes) tmpString += smoke_delete_fire_high;
- if (mUsingColors && mUsingHighRes) tmpString += smoke_delete_colors_high;
- }
+ tmpString += smoke_delete_variables_high;
+ tmpString += smoke_delete_grids_high;
+ tmpString += smoke_delete_fire_high;
+ tmpString += smoke_delete_colors_high;
// Make sure that everything is garbage collected
tmpString += gc_collect;
@@ -413,15 +413,12 @@ FLUID::~FLUID()
// Just in case: gc again
tmpString += gc_collect;
- std::string finalString = parseScript(tmpString, NULL); // Safe to pass NULL argument since only looking up IDs
+ // Safe to pass NULL argument since only looking up IDs
+ std::string finalString = parseScript(tmpString, NULL);
mCommands.clear();
mCommands.push_back(finalString);
runPythonString(mCommands);
- // Let Mantaflow do some cleanup
-// if (mantaInitialized)
-// terminateMantaflow();
-
// Reset pointers to avoid dangling pointers
mDensity = NULL;
mHeat = NULL;
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 928b6e5b617..597c52f79e4 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -2437,26 +2437,6 @@ 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