Fix cloth UI + tooltips - patch provided by nudelZ

This commit is contained in:
Daniel Genrich 2009-07-13 22:35:04 +00:00
parent 2ba8b72157
commit 8f98c5e873
2 changed files with 29 additions and 26 deletions

@ -40,19 +40,23 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
split = layout.split()
col = split.column()
col = split.column(align=True)
col.itemR(cloth, "quality", slider=True)
col.itemR(cloth, "gravity")
subcol = col.column(align=True)
subcol.itemR(cloth, "mass")
subcol.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Stiffness:")
col.itemR(cloth, "pin_cloth", text="Pin")
col = col.column(align=True)
col.active = cloth.pin_cloth
col.itemR(cloth, "pin_stiffness", text="Stiffness")
col.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
col = split.column(align=True)
col.itemL(text="Presets...")
col.itemL(text="")
col.itemR(cloth, "mass")
col.itemR(cloth, "structural_stiffness", text="Structural")
col.itemR(cloth, "bending_stiffness", text="Bending")
col.itemL(text="Damping:")
col.itemL(text="Damping")
col.itemR(cloth, "spring_damping", text="Spring")
col.itemR(cloth, "air_damping", text="Air")
@ -133,21 +137,21 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
def draw(self, context):
layout = self.layout
cloth = context.cloth.collision_settings
split = layout.split()
layout.active = cloth.enable_collision
layout.active = cloth.enable_collision
col = layout.column_flow()
col.itemR(cloth, "collision_quality", slider=True)
col = split.column(align=True)
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", text="Distance")
col.itemR(cloth, "friction")
col.itemR(cloth, "min_distance", text="MinDistance")
layout.itemR(cloth, "enable_self_collision", text="Self Collision")
col = layout.column_flow()
col = split.column(align="True")
col.itemR(cloth, "enable_self_collision", text="Self Collision")
col = col.column(align=True)
col.active = cloth.enable_self_collision
col.itemR(cloth, "self_collision_quality", slider=True)
col.itemR(cloth, "self_min_distance", text="MinDistance")
col.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
col.itemR(cloth, "self_min_distance", text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
__idname__ = "PHYSICS_PT_stiffness"
@ -173,16 +177,15 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
sub = split.column(align=True)
sub.itemL(text="Structural Stiffness:")
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
sub.itemR(cloth, "structural_stiffness_max", text="Max")
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
sub = split.column(align=True)
sub.itemL(text="Bending Stiffness:")
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
sub.itemR(cloth, "bending_stiffness_max", text="Max")
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
bpy.types.register(PHYSICS_PT_cloth_collision)
bpy.types.register(PHYSICS_PT_cloth_stiffness)

@ -215,7 +215,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex group for fine control over mass distribution.");
RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices.");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_VECTOR);
@ -235,7 +235,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL);
RNA_def_property_ui_text(prop, "Pin Cloth", "Define forces for vertices to stick to animated position.");
RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions.");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE);
@ -363,18 +363,18 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "epsilon");
RNA_def_property_range(prop, 0.001f, 1.0f);
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in, can be changed for each frame.");
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0f, 80.0f);
RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (0=movement not changed, 100=no movement left)");
RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened (higher = less movement).");
RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
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_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)");
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, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update");
/* self collision */