[Bf-blender-cvs] [4fdda03] alembic: Better defaults for stretch stiffness and damping.

Lukas Tönne noreply at git.blender.org
Tue Apr 7 14:46:50 CEST 2015


Commit: 4fdda03150e517d63e351d4ecbbc81980a1fc329
Author: Lukas Tönne
Date:   Tue Apr 7 14:41:48 2015 +0200
Branches: alembic
https://developer.blender.org/rB4fdda03150e517d63e351d4ecbbc81980a1fc329

Better defaults for stretch stiffness and damping.

The strong stretch forces lead to awkward lengthening of segments when
the damping factor is too high.

In fact, in a natural hair strand the stretching usually means the hair
itself is curly and stretches as a helical spring. In that case
the damping is quite small compared to the stiffness, and little energy
is lost to the stretching (the hair becomes "bouncy"). When the hair is
very stiff the damping should also be small in order to avoid extreme
forces resulting from the hair root location constraint.

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

M	source/blender/blenkernel/intern/cache_library.c
M	source/blender/makesrna/intern/rna_cache_library.c

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

diff --git a/source/blender/blenkernel/intern/cache_library.c b/source/blender/blenkernel/intern/cache_library.c
index a1af694..67ba857 100644
--- a/source/blender/blenkernel/intern/cache_library.c
+++ b/source/blender/blenkernel/intern/cache_library.c
@@ -567,7 +567,7 @@ static void hairsim_params_init(HairSimParams *params)
 	params->drag = 0.1f;
 	
 	params->stretch_stiffness = 1000.0f;
-	params->stretch_damping = 1.0f;
+	params->stretch_damping = 0.1f;
 	params->bend_stiffness = 100.0f;
 	params->bend_damping = 1.0f;
 	params->goal_stiffness = 0.0f;
diff --git a/source/blender/makesrna/intern/rna_cache_library.c b/source/blender/makesrna/intern/rna_cache_library.c
index 4de85f5..7da5f37 100644
--- a/source/blender/makesrna/intern/rna_cache_library.c
+++ b/source/blender/makesrna/intern/rna_cache_library.c
@@ -218,14 +218,14 @@ static void rna_def_hair_sim_params(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "stretch_stiffness", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
-	RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 0.1f, 3);
+	RNA_def_property_ui_range(prop, 0.0f, 10000.0f, 0.1f, 3);
 	RNA_def_property_ui_text(prop, "Stretch Stiffness", "Resistence to stretching");
 	RNA_def_property_update(prop, 0, "rna_CacheModifier_update");
 	
 	prop = RNA_def_property(srna, "stretch_damping", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
-	RNA_def_property_float_default(prop, 1.0f);
+	RNA_def_property_float_default(prop, 0.1f);
 	RNA_def_property_ui_text(prop, "Stretch Damping", "Damping factor of stretch springs");
 	RNA_def_property_update(prop, 0, "rna_CacheModifier_update");




More information about the Bf-blender-cvs mailing list