[Bf-blender-cvs] [c94b4a7] hair_system: Reenabled hair air drag.

Lukas Tönne noreply at git.blender.org
Sun Oct 5 14:57:06 CEST 2014


Commit: c94b4a7dc140f39fec02a5373d0ba1432ff05a86
Author: Lukas Tönne
Date:   Sat Oct 4 14:35:43 2014 +0200
Branches: hair_system
https://developer.blender.org/rBc94b4a7dc140f39fec02a5373d0ba1432ff05a86

Reenabled hair air drag.

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

M	release/scripts/startup/bl_ui/properties_physics_hair.py
M	source/blender/makesrna/intern/rna_hair.c
M	source/blender/physics/intern/BPH_mass_spring.cpp

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_hair.py b/release/scripts/startup/bl_ui/properties_physics_hair.py
index 39d50bf..fc3421d 100644
--- a/release/scripts/startup/bl_ui/properties_physics_hair.py
+++ b/release/scripts/startup/bl_ui/properties_physics_hair.py
@@ -72,6 +72,11 @@ class PHYSICS_PT_hair_simulation(PhysicButtonsPanel, Panel):
         col.prop(params, "stretch_damping")
         col.prop(params, "bend_damping")
 
+        split = layout.split()
+
+        col = split.column()
+        col.prop(params, "drag")
+
 class PHYSICS_PT_hair_field_weights(PhysicButtonsPanel, Panel):
     bl_label = "Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
@@ -102,9 +107,6 @@ class PHYSICS_PT_hair_collision(PhysicButtonsPanel, Panel):
         col.prop(params, "friction")
         col.prop(params, "margin")
 
-        col = split.column()
-        col.prop(params, "drag")
-
 
 class PHYSICS_PT_hair_render(PhysicButtonsPanel, Panel):
     bl_label = "Hair Render"
diff --git a/source/blender/makesrna/intern/rna_hair.c b/source/blender/makesrna/intern/rna_hair.c
index d731d0e..adfeaca 100644
--- a/source/blender/makesrna/intern/rna_hair.c
+++ b/source/blender/makesrna/intern/rna_hair.c
@@ -264,7 +264,7 @@ static void rna_def_hair_params(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "drag", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "drag");
 	RNA_def_property_range(prop, 0.0f, FLT_MAX);
-	RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 3);
+	RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1f, 3);
 	RNA_def_property_float_default(prop, 0.0f);
 	RNA_def_property_ui_text(prop, "Drag", "Air drag factor");
 
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 36dfa39..46847fd 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -854,29 +854,21 @@ void BPH_hair_solver_set_positions(HairSolverData *data, Object *ob, HairSystem
 
 static void hair_calc_force(HairSolverData *data, HairParams *params, float time, SimDebugData *debug_data)
 {
-	/* Collect forces and derivatives:  F, dFdX, dFdV */
-//	Cloth *cloth = clmd->clothObject;
-//	Implicit_Data *data = cloth->implicit;
-//	unsigned int i	= 0;
-//	MFace 		*mfaces 	= cloth->mfaces;
-//	unsigned int numverts = cloth->numverts;
-	
 #ifdef CLOTH_FORCE_GRAVITY
 	/* global acceleration (gravitation) */
 	float gravity[3];
-//	mul_v3_v3fl(gravity, data->gravity, 0.001f * params->effector_weights->global_gravity);
 	mul_v3_v3fl(gravity, data->gravity, params->effector_weights->global_gravity);
 	BPH_mass_spring_force_gravity(data->id, gravity);
 #endif
-
-#if 0
-	cloth_calc_volume_force(clmd);
-
+	
+//	cloth_calc_volume_force(clmd);
+	
 #ifdef CLOTH_FORCE_DRAG
 	float drag = params->drag;
 	BPH_mass_spring_force_drag(data->id, drag);
 #endif
 	
+#if 0
 	/* handle external forces like wind */
 	if (effectors) {
 		/* cache per-vertex forces to avoid redundant calculation */




More information about the Bf-blender-cvs mailing list