[Bf-blender-cvs] [c4ef2e2f2eb] blender2.8: Cloth: Improve UI

Luca Rood noreply at git.blender.org
Fri Sep 14 15:56:38 CEST 2018


Commit: c4ef2e2f2ebcd9967aa5d4b283ac7abe51156d51
Author: Luca Rood
Date:   Fri Sep 14 15:46:55 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc4ef2e2f2ebcd9967aa5d4b283ac7abe51156d51

Cloth: Improve UI

This reorganizes the cloth UI, and changes some of the behaviour to be
more reasonable.

Changes included here:
* Reorganized cloth panels
* Improved some tooltips
* Removed `vel_damping` option
* Removed cloth pinning checkbox
* Removed stiffness scaling checkbox
* Separated shrinking from sewing
* Separated self collisions from object collisions

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D3691

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

M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/BKE_cloth.h
M	source/blender/blenkernel/intern/cloth.c
M	source/blender/blenkernel/intern/collision.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/makesdna/DNA_cloth_types.h
M	source/blender/makesrna/intern/rna_cloth.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/physics/intern/BPH_mass_spring.cpp

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

diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index bcb0382f8c3..983e2910bce 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -73,63 +73,112 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
 
         col = flow.column()
         col.prop(cloth, "quality", text="Quality Steps")
+        col = flow.column()
         col.prop(cloth, "time_scale", text="Speed Multiplier")
-        col.prop(cloth, "bending_model")
 
-        col.separator()
 
+class PHYSICS_PT_cloth_physical_properties(PhysicButtonsPanel, Panel):
+    bl_label = "Physical Properties"
+    bl_parent_id = 'PHYSICS_PT_cloth'
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        md = context.cloth
+        cloth = md.settings
+
+        layout.active = cloth_panel_enabled(md)
+
+        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
+
+        col = flow.column()
+        col.prop(cloth, "mass", text="Mass")
         col = flow.column()
-        col.prop(cloth, "mass", text="Material Mass")
-        col.prop(cloth, "air_damping", text="Air")
-        col.prop(cloth, "vel_damping", text="Velocity")
+        col.prop(cloth, "air_damping", text="Air Viscosity")
+        col = flow.column()
+        col.prop(cloth, "bending_model")
 
-        col.separator()
+
+class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
+    bl_label = "Stiffness"
+    bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        md = context.cloth
+        cloth = md.settings
+
+        layout.active = cloth_panel_enabled(md)
+
+        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
 
         col = flow.column()
+
         if cloth.bending_model == 'ANGULAR':
-            col.prop(cloth, "tension_stiffness", text="Stiffness Tension")
+            col.prop(cloth, "tension_stiffness", text="Tension")
+            col = flow.column()
             col.prop(cloth, "compression_stiffness", text="Compression")
         else:
-            col.prop(cloth, "tension_stiffness", text="Stiffness Structural")
+            col.prop(cloth, "tension_stiffness", text="Structural")
 
+        col = flow.column()
         col.prop(cloth, "shear_stiffness", text="Shear")
+        col = flow.column()
         col.prop(cloth, "bending_stiffness", text="Bending")
 
-        col.separator()
+
+class PHYSICS_PT_cloth_damping(PhysicButtonsPanel, Panel):
+    bl_label = "Damping"
+    bl_parent_id = 'PHYSICS_PT_cloth_physical_properties'
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+
+    def draw(self, context):
+        layout = self.layout
+        layout.use_property_split = True
+
+        md = context.cloth
+        cloth = md.settings
+
+        layout.active = cloth_panel_enabled(md)
+
+        flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
 
         col = flow.column()
+
         if cloth.bending_model == 'ANGULAR':
-            col.prop(cloth, "tension_damping", text="Damping Tension")
+            col.prop(cloth, "tension_damping", text="Tension")
+            col = flow.column()
             col.prop(cloth, "compression_damping", text="Compression")
         else:
-            col.prop(cloth, "tension_damping", text="Damping Structural")
+            col.prop(cloth, "tension_damping", text="Structural")
 
+        col = flow.column()
         col.prop(cloth, "shear_damping", text="Shear")
-        col.prop(cloth, "bending_damping", text="Bending")
-
         col = flow.column()
-        col.prop(cloth, "use_dynamic_mesh", text="Dynamic Mesh")
-
-        key = ob.data.shape_keys
-
-        if key:
-            row = col.row(align=True)
-            row.active = not cloth.use_dynamic_mesh
-            row.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="Rest Shape Key")
+        col.prop(cloth, "bending_damping", text="Bending")
 
 
-class PHYSICS_PT_cloth_pinning(PhysicButtonsPanel, Panel):
-    bl_label = "Pinning"
+class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
+    bl_label = "Cache"
     bl_parent_id = 'PHYSICS_PT_cloth'
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
 
-    def draw_header(self, context):
+    def draw(self, context):
         md = context.cloth
-        cloth = md.settings
+        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
+
 
-        self.layout.active = cloth_panel_enabled(md)
-        self.layout.prop(cloth, "use_pin_cloth", text="")
+class PHYSICS_PT_cloth_shape(PhysicButtonsPanel, Panel):
+    bl_label = "Shape"
+    bl_parent_id = 'PHYSICS_PT_cloth'
+    bl_options = {'DEFAULT_CLOSED'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
 
     def draw(self, context):
         layout = self.layout
@@ -139,40 +188,44 @@ class PHYSICS_PT_cloth_pinning(PhysicButtonsPanel, Panel):
         ob = context.object
         cloth = md.settings
 
-        layout.active = cloth_panel_enabled(md) and cloth.use_pin_cloth
+        layout.active = cloth_panel_enabled(md)
 
         flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
 
-        col = flow.column()
+        col = flow.column(align=True)
+        col.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="Pin Group")
 
-        col.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="Mass Group")
+        sub = col.column(align=True)
+        sub.active = cloth.vertex_group_mass != ""
+        sub.prop(cloth, "pin_stiffness", text="Stiffness")
 
-        col = flow.column()
-        col.prop(cloth, "pin_stiffness", text="Stiffness")
+        col.separator()
 
-        # Disabled for now.
-        """
-        if cloth.vertex_group_mass:
-            col = flow.column()
-            col.prop(cloth, "goal_default", text="Goal Default")
-            col.prop(cloth, "goal_spring", text="Stiffness")
-            col.prop(cloth, "goal_friction", text="Friction")
-        """
+        col = flow.column(align=True)
+        col.prop(cloth, "use_sewing_springs", text="Sewing")
 
+        sub = col.column(align=True)
+        sub.active = cloth.use_sewing_springs
+        sub.prop(cloth, "sewing_force_max", text="Max Sewing Force")
 
-class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel):
-    bl_label = "Cache"
-    bl_parent_id = 'PHYSICS_PT_cloth'
-    bl_options = {'DEFAULT_CLOSED'}
-    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+        col.separator()
 
-    def draw(self, context):
-        md = context.cloth
-        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
+        col = flow.column()
+        col.prop(cloth, "shrink_min", text="Shrinking Factor")
 
+        col = flow.column()
+        col.prop(cloth, "use_dynamic_mesh", text="Dynamic Mesh")
+
+        key = ob.data.shape_keys
 
-class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
-    bl_label = "Collision"
+        if key:
+            col = flow.column()
+            col.active = not cloth.use_dynamic_mesh
+            col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="Rest Shape Key")
+
+
+class PHYSICS_PT_cloth_object_collision(PhysicButtonsPanel, Panel):
+    bl_label = "Object Collision"
     bl_parent_id = 'PHYSICS_PT_cloth'
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@@ -207,14 +260,14 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
 
 class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel):
     bl_label = "Self Collision"
-    bl_parent_id = 'PHYSICS_PT_cloth_collision'
+    bl_parent_id = 'PHYSICS_PT_cloth'
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
 
     def draw_header(self, context):
         cloth = context.cloth.collision_settings
 
-        self.layout.active = cloth_panel_enabled(context.cloth) and cloth.use_self_collision
+        self.layout.active = cloth_panel_enabled(context.cloth)
         self.layout.prop(cloth, "use_self_collision", text="")
 
     def draw(self, context):
@@ -225,7 +278,7 @@ class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel):
         md = context.cloth
         ob = context.object
 
-        layout.active = cloth.use_collision and cloth_panel_enabled(md) and cloth.use_self_collision
+        layout.active = cloth.use_self_collision and cloth_panel_enabled(md)
 
         flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
 
@@ -237,18 +290,12 @@ class PHYSICS_PT_cloth_self_collision(PhysicButtonsPanel, Panel):
         col.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="Vertex Group")
 
 
-class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
-    bl_label = "Stiffness Scaling"
+class PHYSICS_PT_cloth_property_weights(PhysicButtonsPanel, Panel):
+    bl_label = "Property Weights"
     bl_parent_id = 'PHYSICS_PT_cloth'
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
 
-    def draw_header(self, context):
-        cloth = context.cloth.settings
-
-        self.layout.active = cloth_panel_enabled(context.cloth)
-        self.layout.prop(cloth, "use_stiffness_scale", text="")
-
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
@@ -257,7 +304,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel):
         ob = context.object
         cloth = context.cloth.settings
 
-        layout

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list