[Bf-blender-cvs] [a8901bc63e7] fluid-mantaflow: added adaptive time stepping option to ui

Sebastián Barschkis noreply at git.blender.org
Sun Mar 26 20:41:41 CEST 2017


Commit: a8901bc63e7519f4f838cee784c8f01576d6f7f0
Author: Sebastián Barschkis
Date:   Sun Mar 26 20:38:26 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBa8901bc63e7519f4f838cee784c8f01576d6f7f0

added adaptive time stepping option to ui

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

M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/strings/shared_script.h
M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	source/blender/makesdna/DNA_smoke_types.h
M	source/blender/makesrna/intern/rna_smoke.c

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

diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 5c341274b74..37d4fcf9fa6 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -628,6 +628,8 @@ std::string FLUID::getRealValue(const std::string& varName,  SmokeModifierData *
 		else if (smd->domain->preconditioner == MOD_SMOKE_PC_MG_STATIC) ss << "PcMGStatic";
 	} else if (varName == "ID")
 		ss << mCurrentID;
+	else if (varName == "USING_ADAPTIVETIME")
+		ss << (smd->domain->flags & MOD_SMOKE_ADAPTIVE_TIME ? "True" : "False");
 	else
 		std::cout << "ERROR: Unknown option: " << varName << std::endl;
 	return ss.str();
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index a899e850087..7e03c1464c1 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -69,7 +69,7 @@ boundaryWidth_s$ID$       = 1\n\
 obvelBorderWidth_s$ID$    = 2\n\
 \n\
 using_highres_s$ID$   = $USING_HIGHRES$\n\
-using_adaptTime_s$ID$ = True # adaptive time stepping disabled for now\n";
+using_adaptTime_s$ID$ = $USING_ADAPTIVETIME$\n";
 
 const std::string fluid_variables_high= "\n\
 upres_xl$ID$  = $UPRES$\n\
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index aae74c5b9a6..ab56a85b4ef 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -62,6 +62,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
             flow = md.flow_settings
 
             layout.prop(domain, "smoke_domain_type", expand=False)
+            layout.prop(domain, "collision_extents", expand=False)
 
             split = layout.split()
 
@@ -70,9 +71,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
             col = split.column()
             col.label(text="Time:")
             col.prop(domain, "time_scale", text="Scale")
-
-            col.label(text="Border Collisions:")
-            col.prop(domain, "collision_extents", text="")
+            col.prop(domain, "use_adaptive_stepping", text="Adaptive stepping")
             
             col = split.column()
             if scene.use_gravity:
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 383cde77d3e..e7a9cb3e56d 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -42,6 +42,7 @@ enum {
 	MOD_SMOKE_DISSOLVE = (1 << 2),  /* let smoke dissolve */
 	MOD_SMOKE_DISSOLVE_LOG = (1 << 3),  /* using 1/x for dissolve */
 	MOD_SMOKE_USE_MANTA = (1 << 4),
+	MOD_SMOKE_ADAPTIVE_TIME = (1 << 5), /* adaptive time stepping in domain */
 
 #ifdef DNA_DEPRECATED
 	MOD_SMOKE_HIGH_SMOOTH = (1 << 5),  /* -- Deprecated -- */
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 130eec1dd78..190aceb22f9 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -772,6 +772,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
 	RNA_def_property_ui_range(prop, 0.0001, 10.0, 0.02, 5);
 	RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
 	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
+	
+	prop = RNA_def_property(srna, "use_adaptive_stepping", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_ADAPTIVE_TIME);
+	RNA_def_property_ui_text(prop, "Adaptive stepping", "Enable adaptive time-stepping");
+	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache");
 
 	prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "vorticity");




More information about the Bf-blender-cvs mailing list