From ca93ebee7fe49c9b89b748e404b22b87c8eb2de0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Jul 2016 14:44:28 +1000 Subject: Cloth: UI cleanup & quality hard limit removal D2121 by @LucaRood --- .../startup/bl_ui/properties_physics_cloth.py | 37 ++++++++++++++-------- source/blender/makesrna/intern/rna_cloth.c | 9 ++++-- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index 2f1798ebd54..37a0390b11d 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -60,20 +60,24 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): ob = context.object cloth = md.settings - split = layout.split() - - split.active = cloth_panel_enabled(md) + layout.active = cloth_panel_enabled(md) - col = split.column() + split = layout.split(percentage=0.25) - col.label(text="Presets:") - sub = col.row(align=True) + split.label(text="Presets:") + sub = split.row(align=True) sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label) sub.operator("cloth.preset_add", text="", icon='ZOOMIN') sub.operator("cloth.preset_add", text="", icon='ZOOMOUT').remove_active = True - col.label(text="Quality:") - col.prop(cloth, "quality", text="Steps", slider=True) + split = layout.split(percentage=0.25) + + split.label(text="Quality:") + split.prop(cloth, "quality", text="Steps") + + split = layout.split() + + col = split.column() col.label(text="Material:") col.prop(cloth, "mass") @@ -87,7 +91,11 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col.prop(cloth, "air_damping", text="Air") col.prop(cloth, "vel_damping", text="Velocity") - col.prop(cloth, "use_pin_cloth", text="Pinning") + split = layout.split() + + col = split.column() + + col.prop(cloth, "use_pin_cloth", text="Pinning:") sub = col.column() sub.active = cloth.use_pin_cloth sub.prop_search(cloth, "vertex_group_mass", ob, "vertex_groups", text="") @@ -104,11 +112,14 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): col.prop(cloth, "goal_friction", text="Friction") """ + col = split.column() + key = ob.data.shape_keys if key: - col.label(text="Rest Shape Key:") - col.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="") + sub = col.column() + sub.label(text="Rest Shape Key:") + sub.prop_search(cloth, "rest_shape_key", key, "key_blocks", text="") class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): @@ -144,7 +155,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(cloth, "collision_quality", slider=True, text="Quality") + col.prop(cloth, "collision_quality", text="Quality") col.prop(cloth, "distance_min", slider=True, text="Distance") col.prop(cloth, "repel_force", slider=True, text="Repel") col.prop(cloth, "distance_repel", slider=True, text="Repel Distance") @@ -154,7 +165,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): col.prop(cloth, "use_self_collision", text="Self Collision") sub = col.column() sub.active = cloth.use_self_collision - sub.prop(cloth, "self_collision_quality", slider=True, text="Quality") + sub.prop(cloth, "self_collision_quality", text="Quality") sub.prop(cloth, "self_distance_min", slider=True, text="Distance") sub.prop_search(cloth, "vertex_group_self_collisions", ob, "vertex_groups", text="") diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index c91b6487653..9601c4feb3f 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -436,7 +436,8 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); - RNA_def_property_range(prop, 1, 80); + RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_ui_range(prop, 1, 80, 1, -1); RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); @@ -656,7 +657,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); - RNA_def_property_range(prop, 1, 20); + RNA_def_property_range(prop, 1, SHRT_MAX); + RNA_def_property_ui_range(prop, 1, 20, 1, -1); RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); @@ -681,7 +683,8 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); - RNA_def_property_range(prop, 1, 10); + RNA_def_property_range(prop, 1, SHRT_MAX); + RNA_def_property_ui_range(prop, 1, 10, 1, -1); RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done " "(higher is better quality but slower)"); -- cgit v1.2.3