Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2010-07-27 18:53:20 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2010-07-27 18:53:20 +0400
commit967d25ac1c269f28ab793f7c63edb9fd540dd5cf (patch)
treeb7f11d79ea4faa9e0f12ea1482d79a98f02f09c1 /source/blender/makesrna/intern/rna_smoke.c
parentecb58629f2f91a3381fafc03d2ec394b0d6a097f (diff)
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
Diffstat (limited to 'source/blender/makesrna/intern/rna_smoke.c')
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c56
1 files changed, 49 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index d4ff98e9701..56049ea15ce 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -120,6 +120,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem smoke_domain_colli_items[] = {
+ {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
+ {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"},
+ {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
+ {0, NULL, 0, NULL, NULL}};
+
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
@@ -192,8 +198,8 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
- RNA_def_property_range(prop, 1.0, 10.0);
- RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2);
+ RNA_def_property_range(prop, 0.0, 10.0);
+ RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
@@ -204,11 +210,6 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_INITVELOCITY);
- RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
- RNA_def_property_update(prop, 0, NULL);
-
prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
@@ -241,12 +242,36 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
+ prop= RNA_def_property(srna, "smoke_domain_colli", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
+ RNA_def_property_enum_items(prop, smoke_domain_colli_items);
+ RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
+ RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
+ prop= RNA_def_property(srna, "smoothemitter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
+ RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "time_scale");
+ RNA_def_property_range(prop, 0.2, 1.5);
+ RNA_def_property_ui_range(prop, 0.2, 1.5, 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_reset");
+
+ prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vorticity");
+ RNA_def_property_range(prop, 0.01, 4.0);
+ RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
+ RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
@@ -284,6 +309,23 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
+ RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
+ RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "velocity_multiplier", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vel_multi");
+ RNA_def_property_range(prop, -2.0, 2.0);
+ RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
+ RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
+ RNA_def_property_update(prop, 0, NULL);
}
static void rna_def_smoke_coll_settings(BlenderRNA *brna)