diff options
author | Luca Rood <dev@lucarood.com> | 2018-09-14 16:46:55 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2018-09-14 16:52:00 +0300 |
commit | c4ef2e2f2ebcd9967aa5d4b283ac7abe51156d51 (patch) | |
tree | 031fed256c5ccb0428011a583535f37a88e2eb27 /release/scripts/startup/bl_ui | |
parent | 1287965089a851c46e9a1a23c55ebc90b00b4e14 (diff) |
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
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_physics_cloth.py | 226 |
1 files changed, 124 insertions, 102 deletions
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.active = (cloth.use_stiffness_scale and cloth_panel_enabled(md)) + layout.active = cloth_panel_enabled(md) flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) @@ -267,7 +314,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): text="Structural Group" ) col.prop(cloth, "tension_stiffness_max", text="Max Tension") - col.prop(cloth, "compression_stiffness_max", text="Compression") + col.prop(cloth, "compression_stiffness_max", text="Max Compression") col.separator() @@ -276,7 +323,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): cloth, "vertex_group_shear_stiffness", ob, "vertex_groups", text="Shear Group" ) - col.prop(cloth, "shear_stiffness_max", text="Max") + col.prop(cloth, "shear_stiffness_max", text="Max Shearing") col.separator() @@ -285,43 +332,16 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): cloth, "vertex_group_bending", ob, "vertex_groups", text="Bending Group" ) - col.prop(cloth, "bending_stiffness_max", text="Max") - - -class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel): - bl_label = "Sewing Springs" - 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_sewing_springs", text="") - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - - md = context.cloth - ob = context.object - cloth = context.cloth.settings - - layout.active = (cloth.use_sewing_springs and cloth_panel_enabled(md)) - flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) - - col = flow.column() - col.prop(cloth, "sewing_force_max", text="Sewing Force") + col.prop(cloth, "bending_stiffness_max", text="Max Bending") col.separator() - col = col.column() - col.prop_search(cloth, "vertex_group_shrink", ob, "vertex_groups", text="Shrinking Group") - - col = flow.column(align=True) - col.prop(cloth, "shrink_min", text="Min") - col.prop(cloth, "shrink_max", text="Max") + col = flow.column() + col.prop_search( + cloth, "vertex_group_shrink", ob, "vertex_groups", + text="Shrinking Group" + ) + col.prop(cloth, "shrink_max", text="Max Shrinking") class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): @@ -338,12 +358,14 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): classes = ( CLOTH_PT_presets, PHYSICS_PT_cloth, + PHYSICS_PT_cloth_physical_properties, + PHYSICS_PT_cloth_stiffness, + PHYSICS_PT_cloth_damping, PHYSICS_PT_cloth_cache, - PHYSICS_PT_cloth_collision, + PHYSICS_PT_cloth_shape, + PHYSICS_PT_cloth_object_collision, PHYSICS_PT_cloth_self_collision, - PHYSICS_PT_cloth_pinning, - PHYSICS_PT_cloth_stiffness, - PHYSICS_PT_cloth_sewing, + PHYSICS_PT_cloth_property_weights, PHYSICS_PT_cloth_field_weights, ) |