Cloth: UI cleanup & quality hard limit removal

D2121 by @LucaRood
This commit is contained in:
Campbell Barton 2016-07-30 14:44:28 +10:00
parent ca983d1825
commit ca93ebee7f
2 changed files with 30 additions and 16 deletions

View File

@ -60,20 +60,24 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
ob = context.object
cloth = md.settings
split = layout.split()
layout.active = cloth_panel_enabled(md)
split.active = cloth_panel_enabled(md)
split = layout.split(percentage=0.25)
col = split.column()
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="")

View File

@ -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)");