[Bf-blender-cvs] [fd2e058] hair_system: More sensible defaults and ranges for the hair sim settings.

Lukas Tönne noreply at git.blender.org
Sat Aug 2 11:09:37 CEST 2014


Commit: fd2e0585716e937ec6fd2a1dda2bdbdf9b28d390
Author: Lukas Tönne
Date:   Sat Aug 2 11:06:26 2014 +0200
Branches: hair_system
https://developer.blender.org/rBfd2e0585716e937ec6fd2a1dda2bdbdf9b28d390

More sensible defaults and ranges for the hair sim settings.

Note that this will probably change again in the future. The goal is to
make the simulation as stable as possible in the default ui range of
properties (artists can override soft limits, but then instability has
to be expected).

Currently spring forces and damping depend somewhat on the time step
size and hair segment length. Also reparameterizing properties a bit
could help to increase accuracy in artistically interesting ranges.

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

M	source/blender/blenkernel/intern/hair.c
M	source/blender/makesrna/intern/rna_hair.c

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

diff --git a/source/blender/blenkernel/intern/hair.c b/source/blender/blenkernel/intern/hair.c
index e621bad..5411c4b 100644
--- a/source/blender/blenkernel/intern/hair.c
+++ b/source/blender/blenkernel/intern/hair.c
@@ -44,8 +44,10 @@ HairSystem *BKE_hairsys_new(void)
 {
 	HairSystem *hsys = MEM_callocN(sizeof(HairSystem), "hair system");
 	
-	hsys->params.stretch_stiffness = 7.0e6f;
-	hsys->params.stretch_damping = 4500.0f;
+	hsys->params.stretch_stiffness = 2000.0f;
+	hsys->params.stretch_damping = 10.0f;
+	hsys->params.bend_stiffness = 40.0f;
+	hsys->params.bend_damping = 10.0f;
 	
 	return hsys;
 }
diff --git a/source/blender/makesrna/intern/rna_hair.c b/source/blender/makesrna/intern/rna_hair.c
index e5aab41..b724d10 100644
--- a/source/blender/makesrna/intern/rna_hair.c
+++ b/source/blender/makesrna/intern/rna_hair.c
@@ -63,25 +63,25 @@ static void rna_def_hair_params(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "stretch_stiffness", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "stretch_stiffness");
 	RNA_def_property_range(prop, 0.0f, 1.0e9f);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0e8f, 0.1, 2);
+	RNA_def_property_ui_range(prop, 0.0f, 3000.0f, 0.1, 2);
 	RNA_def_property_ui_text(prop, "Stretch Stiffness", "");
 
 	prop = RNA_def_property(srna, "stretch_damping", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "stretch_damping");
 	RNA_def_property_range(prop, 0.0f, 1.0e6f);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0e5f, 0.1, 2);
+	RNA_def_property_ui_range(prop, 0.0f, 20.0f, 0.1, 2);
 	RNA_def_property_ui_text(prop, "Stretch Damping", "");
 
 	prop = RNA_def_property(srna, "bend_stiffness", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "bend_stiffness");
 	RNA_def_property_range(prop, 0.0f, 1.0e9f);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0e8f, 0.1, 2);
+	RNA_def_property_ui_range(prop, 0.0f, 500.0f, 0.1, 2);
 	RNA_def_property_ui_text(prop, "Bend Stiffness", "");
 
 	prop = RNA_def_property(srna, "bend_damping", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "bend_damping");
 	RNA_def_property_range(prop, 0.0f, 1.0e6f);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0e5f, 0.1, 2);
+	RNA_def_property_ui_range(prop, 0.0f, 20.0f, 0.1, 2);
 	RNA_def_property_ui_text(prop, "Bend Damping", "");
 }




More information about the Bf-blender-cvs mailing list