[Bf-blender-cvs] [07d241f] fluid-mantaflow: UI customizations: distinguish between flow type and flow behavior

Sebastián Barschkis noreply at git.blender.org
Thu Jul 7 00:11:43 CEST 2016


Commit: 07d241fbe24b5d8594ab3d6eca92d2d90e03f55f
Author: Sebastián Barschkis
Date:   Wed Jul 6 17:23:51 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB07d241fbe24b5d8594ab3d6eca92d2d90e03f55f

UI customizations: distinguish between flow type and flow behavior

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

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/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index ff1e65c..d79bd28 100644
--- a/release/scripts/startup/bl_ui/properties_physics_smoke.py
+++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py
@@ -84,7 +84,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
 
             layout.prop(flow, "smoke_flow_type", expand=False)
 
-            if flow.smoke_flow_type != 'OUTFLOW':
+            if flow.smoke_flow_type != 'LIQUID':
                 split = layout.split()
                 col = split.column()
                 col.label(text="Flow Source:")
@@ -110,7 +110,11 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
                     sub.prop(flow, "velocity_normal")
                     #sub.prop(flow, "velocity_random")
 
-                sub = split.column()
+                col = split.column()
+                col.label(text="Flow behavior:")
+                col.prop(flow, "smoke_flow_behavior", text="")
+
+                sub = col.column()
                 sub.label(text="Initial Values:")
                 sub.prop(flow, "use_absolute")
                 if flow.smoke_flow_type in {'SMOKE', 'BOTH'}:
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 6b88c33..9fbb7cc 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -190,6 +190,11 @@ typedef struct SmokeDomainSettings {
 #define MOD_SMOKE_FLOW_TYPE_SMOKEFIRE 3
 #define MOD_SMOKE_FLOW_TYPE_LIQUID 4
 
+/* behavior */
+#define MOD_SMOKE_FLOW_BEHAVIOR_INFLOW 0
+#define MOD_SMOKE_FLOW_BEHAVIOR_OUTFLOW 1
+#define MOD_SMOKE_FLOW_BEHAVIOR_STATIC 2
+
 /* flow source */
 #define MOD_SMOKE_FLOW_SOURCE_PARTICLES 0
 #define MOD_SMOKE_FLOW_SOURCE_MESH 1
@@ -233,8 +238,10 @@ typedef struct SmokeFlowSettings {
 	short vgroup_density;
 
 	short type; /* smoke, flames, both, outflow, liquid */
+	short behavior; /* inflow, outflow, static */
 	short source;
 	short texture_type;
+	short pad2[3];
 	int flags; /* absolute emission etc*/
 } SmokeFlowSettings;
 
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 82a3d51..825e6b3 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -794,6 +794,13 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
 		{MOD_SMOKE_FLOW_TYPE_LIQUID, "LIQUID", 0, "Liquid", "Add liquid"},
 		{0, NULL, 0, NULL, NULL}
 	};
+	
+	static EnumPropertyItem smoke_flow_behaviors[] = {
+		{MOD_SMOKE_FLOW_BEHAVIOR_INFLOW, "INFLOW", 0, "Inflow", "Add fluid to simulation"},
+		{MOD_SMOKE_FLOW_BEHAVIOR_OUTFLOW, "OUTFLOW", 0, "Outflow", "Delete fluid from simulation"},
+		{MOD_SMOKE_FLOW_BEHAVIOR_STATIC, "STATIC", 0, "Static", "Only use given geometry for fluid"},
+		{0, NULL, 0, NULL, NULL}
+	};
 
 	static EnumPropertyItem smoke_flow_sources[] = {
 		{MOD_SMOKE_FLOW_SOURCE_PARTICLES, "PARTICLES", ICON_PARTICLES, "Particle System", "Emit smoke from particles"},
@@ -848,7 +855,13 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "smoke_flow_type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "type");
 	RNA_def_property_enum_items(prop, smoke_flow_types);
-	RNA_def_property_ui_text(prop, "Flow Type", "Change how flow affects the simulation");
+	RNA_def_property_ui_text(prop, "Flow Type", "Change type of fluid in the simulation");
+	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
+	
+	prop = RNA_def_property(srna, "smoke_flow_behavior", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "behavior");
+	RNA_def_property_enum_items(prop, smoke_flow_behaviors);
+	RNA_def_property_ui_text(prop, "Flow Behavior", "Change flow behavior in the simulation");
 	RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset");
 
 	prop = RNA_def_property(srna, "smoke_flow_source", PROP_ENUM, PROP_NONE);




More information about the Bf-blender-cvs mailing list