From d3a6c0c834d34b0158443bee8064631d289d5a57 Mon Sep 17 00:00:00 2001 From: Miika Hamalainen Date: Fri, 17 May 2013 17:45:37 +0000 Subject: Smoke simulator: Add flow subframes and ability to set custom particle size. Previously it was nearly impossible to have fast moving objects emitting smoke or they would just leave behind a row of smoke poofs instead of continious stream of smoke. Now it's possible to set number of subframes for each smoke flow. Another new thing is ability to set size of smoke flow particles instead of using closest smoke cell. This also works with my earlier "full sample" commit, so no more blocky particles either. :) For more info check my blog post: http://www.miikahweb.com/en/blog/2013/05/17/blender-smoke-subframes This commit also includes couple of fixes I spotted while testing: * Fix: dissolve was applied at different time for low res and high res simulations. * Fix: full sample setting didn't get copied with domain. --- source/blender/makesrna/intern/rna_smoke.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/makesrna/intern/rna_smoke.c') diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 66fd5186fc4..8b01a785f1e 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -559,6 +559,23 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Surface", "Maximum distance from mesh surface to emit smoke"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); + prop = RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.1, 20.0); + RNA_def_property_ui_range(prop, 0.5, 5.0, 0.05, 5); + RNA_def_property_ui_text(prop, "Size", "Particle size in simulation cells"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); + + prop = RNA_def_property(srna, "use_particle_size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_USE_PART_SIZE); + RNA_def_property_ui_text(prop, "Set Size", "Set particle size in simulation cells or use nearest cell"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); + + prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 0, 50); + RNA_def_property_ui_range(prop, 0, 10, 1, -1); + RNA_def_property_ui_text(prop, "Subframes", "Number of additional samples to take between frames to improve quality of fast moving flows"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); + prop = RNA_def_property(srna, "density_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_SmokeFlow_density_vgroup_get", "rna_SmokeFlow_density_vgroup_length", -- cgit v1.2.3