From 8bf8a128c2f1df5c85ee0005d1821316d3e88261 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Sat, 28 Apr 2012 21:46:43 +0000 Subject: Smoke: Support for moving obstacles. (Merge from Smoke2 branch) Sponsored by the Blender Development Fund. http://www.blender.org/blenderorg/blender-foundation/development-fund/ Remarks: The original code was not designed to support moving obstacles so I had to introduce some velocity constraints into the code to prevent smoke from exploding. If this causes problems with "fire" emulation, please let me know. --- source/blender/makesrna/intern/rna_smoke.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 69d76c0e342..b1fed62f87b 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Contributor(s): Daniel Genrich + * Blender Foundation * * ***** END GPL LICENSE BLOCK ***** */ @@ -336,12 +337,25 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) static void rna_def_smoke_coll_settings(BlenderRNA *brna) { + static EnumPropertyItem smoke_coll_type_items[] = { + {SM_COLL_STATIC, "COLLSTATIC", 0, "Static", "Non moving obstacle"}, + {SM_COLL_RIGID, "COLLRIGID", 0, "Rigid", "Rigid obstacle"}, + {SM_COLL_ANIMATED, "COLLANIMATED", 0, "Animated", "Animated obstacle"}, + {0, NULL, 0, NULL, NULL}}; + StructRNA *srna; + PropertyRNA *prop; srna = RNA_def_struct(brna, "SmokeCollSettings", NULL); RNA_def_struct_ui_text(srna, "Collision Settings", "Smoke collision settings"); RNA_def_struct_sdna(srna, "SmokeCollSettings"); RNA_def_struct_path_func(srna, "rna_SmokeCollSettings_path"); + + prop = RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "type"); + RNA_def_property_enum_items(prop, smoke_coll_type_items); + RNA_def_property_ui_text(prop, "Collision type", "Collision type"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); } void RNA_def_smoke(BlenderRNA *brna) -- cgit v1.2.3