[Bf-blender-cvs] [b2dc669ee7] cloth-improvements: Use proper friction property for self col and redesign col UI

Luca Rood noreply at git.blender.org
Fri Jan 20 05:38:45 CET 2017


Commit: b2dc669ee79995cecabd9ced016a69dff8b426e3
Author: Luca Rood
Date:   Thu Jan 19 21:42:29 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rBb2dc669ee79995cecabd9ced016a69dff8b426e3

Use proper friction property for self col and redesign col UI

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

M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	source/blender/blenkernel/intern/collision.c
M	source/blender/makesrna/intern/rna_cloth.c

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index f141ae386a..b4283f4682 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -227,25 +227,20 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
 
         layout.active = cloth_panel_enabled(md)
 
-        split = layout.split()
+        layout.prop(cloth, "collision_quality")
+
+        layout.separator()
+
+        col = layout.column()
 
-        col = split.column()
         col.prop(cloth, "use_collision", text="Object Collision:")
 
         sub = col.column()
         sub.active = cloth.use_collision
-        sub.prop(cloth, "friction")
-
-        col = split.column()
-        col.active = cloth.use_collision
-        col.prop(cloth, "collision_quality", text="Quality")
-        col.prop(cloth, "distance_min", slider=True, text="Distance")
-
-        col = layout.column()
-        col.active = cloth.use_collision
-        col.prop(cloth, "group")
+        sub.prop(cloth, "distance_min", slider=True, text="Distance")
+        sub.prop(cloth, "group")
 
-        col.prop(cloth, "use_normal")
+        sub.prop(cloth, "use_normal")
 
         layout.separator()
 
@@ -253,14 +248,16 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
 
         split = col.split()
 
-        split.prop(cloth, "use_self_collision", text="Self Collision:")
+        sub = split.column()
+        sub.prop(cloth, "use_self_collision", text="Self Collision:")
 
-        sub = col.column()
+        sub = split.column()
         sub.active = cloth.use_self_collision
-        sub.prop(cloth, "self_distance_min", slider=True, text="Distance")
+        sub.prop(cloth, "self_friction", text="Friction")
 
-        sub = layout.column()
+        sub = col.column()
         sub.active = cloth.use_self_collision
+        sub.prop(cloth, "self_distance_min", slider=True, text="Distance")
         sub.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group")
 
 
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index b6ffe2b58d..9c7da86c80 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -523,7 +523,7 @@ static int cloth_selfcollision_response_static (ClothModifierData *clmd, CollPai
 
 			/* Decrease in magnitude of relative tangential velocity due to coulomb friction
 			 * in original formula "magrelVel" should be the "change of relative velocity in normal direction" */
-			magtangent = min_ff(clmd->coll_parms->friction * 0.01f * magrelVel, len_v3(vrel_t_pre));
+			magtangent = min_ff(clmd->coll_parms->self_friction * 0.01f * magrelVel, len_v3(vrel_t_pre));
 
 			/* Apply friction impulse. */
 			if ( magtangent > ALMOST_ZERO ) {
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index c3e3104dc8..6812a5d470 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -847,7 +847,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_range(prop, 0.0f, 80.0f);
-	RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact");
+	RNA_def_property_ui_text(prop, "Self Friction", "Friction with self contact");
 	RNA_def_property_update(prop, 0, "rna_cloth_update");
 
 	prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);




More information about the Bf-blender-cvs mailing list