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:
authorSebastian Parborg <darkdefende@gmail.com>2019-11-27 16:56:16 +0300
committerSebastian Parborg <darkdefende@gmail.com>2019-11-27 17:01:15 +0300
commitf6cefbef22c8c6583b4927c179dabac3eb57aa22 (patch)
tree96785e2ee93f34bb14975a53bc2a4e003ee3fb59 /source/blender/makesrna/intern/rna_cloth.c
parenteb798de101ac7946e2d719e763ad1f0fd3e26acd (diff)
Fix T30941: Add cloth air pressure simulation
This adds some basic simulation of internal air pressure inside of closed cloth mesh objects. Reviewed By: Jacques Lucke Differential Revision: http://developer.blender.org/D5473
Diffstat (limited to 'source/blender/makesrna/intern/rna_cloth.c')
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index e1a06a76235..cf48ed549e6 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -774,6 +774,46 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_cloth_update");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ /* Pressure */
+
+ prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_PRESSURE);
+ RNA_def_property_ui_text(prop, "Use Pressure", "Simulate pressure inside a closed cloth mesh");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+ prop = RNA_def_property(srna, "use_pressure_volume", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL);
+ RNA_def_property_ui_text(
+ prop, "Use Custom Volume", "Use the Volume parameter as the initial volume");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+ prop = RNA_def_property(srna, "uniform_pressure_force", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "uniform_pressure_force");
+ RNA_def_property_range(prop, -10000.0f, 10000.0f);
+ RNA_def_property_float_default(prop, 0.0f);
+ RNA_def_property_ui_text(
+ prop,
+ "Pressure",
+ "The uniform pressure that is constanty applied to the mesh. Can be negative");
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+ prop = RNA_def_property(srna, "target_volume", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "target_volume");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_float_default(prop, 0.0f);
+ RNA_def_property_ui_text(
+ prop, "Target Volume", "The mesh volume where the inner/outer pressure will be the same");
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+ prop = RNA_def_property(srna, "pressure_factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "pressure_factor");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_float_default(prop, 1.0f);
+ RNA_def_property_ui_text(prop, "Pressure Scale", "Air pressure scaling factor");
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
/* unused */
/* unused still */