From 44ca632ce77edbbb0a85f5ca8dde26c68f9efbd1 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Wed, 12 Aug 2009 22:16:47 +0000 Subject: Added game soft body settings, and cleaned up layout there slightly. Also converted some other percentage properties to use sliders, and a few other small layout tweaks. --- release/ui/buttons_data_mesh.py | 17 ++-- release/ui/buttons_data_modifier.py | 9 +- release/ui/buttons_game.py | 174 +++++++++++++++++++++----------- release/ui/buttons_material.py | 12 ++- release/ui/buttons_object.py | 4 +- release/ui/buttons_object_constraint.py | 26 ++--- release/ui/buttons_world.py | 9 +- 7 files changed, 162 insertions(+), 89 deletions(-) (limited to 'release') diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index 3930d1029da..d6ca0817edc 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -106,12 +106,15 @@ class DATA_PT_vertex_groups(DataButtonsPanel): row.itemR(group, "name") if context.edit_object: - row = layout.row(align=True) - - row.itemO("object.vertex_group_assign", text="Assign") - row.itemO("object.vertex_group_remove_from", text="Remove") - row.itemO("object.vertex_group_select", text="Select") - row.itemO("object.vertex_group_deselect", text="Deselect") + row = layout.row() + + sub = row.row(align=True) + sub.itemO("object.vertex_group_assign", text="Assign") + sub.itemO("object.vertex_group_remove_from", text="Remove") + + sub = row.row(align=True) + sub.itemO("object.vertex_group_select", text="Select") + sub.itemO("object.vertex_group_deselect", text="Deselect") layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight") @@ -159,7 +162,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): row.itemR(kb, "value", slider=True) split = layout.split() - sub = split.column() + sub = split.column(align=True) sub.enabled = ob.shape_key_lock == False sub.itemL(text="Range:") sub.itemR(kb, "slider_min", text="Min") diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 63204cfbc3d..6dd11457ec9 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -333,7 +333,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemL(text="See Soft Body panel.") def SUBSURF(self, layout, ob, md): - layout.itemR(md, "subdivision_type") + layout.row().itemR(md, "subdivision_type", expand=True) flow = layout.column_flow() flow.itemR(md, "levels", text="Preview") @@ -349,9 +349,12 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") #layout.itemR(md, "projectors") layout.itemR(md, "image") - layout.itemR(md, "horizontal_aspect_ratio") - layout.itemR(md, "vertical_aspect_ratio") layout.itemR(md, "override_image") + layout.itemL(text="Aspect Ratio:") + col = layout.column(align=True) + col.itemR(md, "horizontal_aspect_ratio", text="Horizontal") + col.itemR(md, "vertical_aspect_ratio", text="Vertical") + #"Projectors" don't work. def WAVE(self, layout, ob, md): diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index ee6260202e8..6d53b6a5327 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -19,72 +19,132 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): ob = context.active_object game = ob.game + soft = ob.game.soft_body layout.itemR(game, "physics_type") layout.itemS() - split = layout.split() - - col = split.column() - col.itemR(game, "actor") - col.itemR(game, "ghost") - col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful - - col = split.column() - col.itemR(game, "do_fh", text="Use Material Physics") - col.itemR(game, "rotation_fh", text="Rotate From Normal") - col.itemR(game, "no_sleeping") - - layout.itemS() - - split = layout.split() - - col = split.column() - col.itemL(text="Attributes:") - sub = col.column(align=True) - sub.itemR(game, "mass") - sub.itemR(game, "radius") - sub.itemR(game, "form_factor") - - col.itemS() - - col.itemL(text="Damping:") - sub = col.column(align=True) - sub.itemR(game, "damping", text="Translation", slider=True) - sub.itemR(game, "rotation_damping", text="Rotation", slider=True) - - col = split.column() - col.itemL(text="Velocity:") - sub = col.column(align=True) - sub.itemR(game, "minimum_velocity", text="Minimum") - sub.itemR(game, "maximum_velocity", text="Maximum") - - col.itemS() - - col.itemR(game, "anisotropic_friction") - sub = col.column() - sub.active = game.anisotropic_friction - sub.itemR(game, "friction_coefficients", text="", slider=True) - - layout.itemS() - - split = layout.split() - - col = split.column() - col.itemL(text="Lock Translation:") - col.itemR(game, "lock_x_axis", text="X") - col.itemR(game, "lock_y_axis", text="Y") - col.itemR(game, "lock_z_axis", text="Z") + #if game.physics_type == 'DYNAMIC': + if game.physics_type in ('DYNAMIC', 'RIGID_BODY'): + + split = layout.split() + + col = split.column() + col.itemR(game, "actor") + col.itemR(game, "ghost") + col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful + + col = split.column() + col.itemR(game, "do_fh", text="Use Material Physics") + col.itemR(game, "rotation_fh", text="Rotate From Normal") + col.itemR(game, "no_sleeping") + + layout.itemS() + + split = layout.split() + + col = split.column() + col.itemL(text="Attributes:") + sub = col.column() + sub.itemR(game, "mass") + sub.itemR(game, "radius") + sub.itemR(game, "form_factor") + + col.itemS() + + col.itemL(text="Damping:") + sub = col.column(align=True) + sub.itemR(game, "damping", text="Translation", slider=True) + sub.itemR(game, "rotation_damping", text="Rotation", slider=True) + + col = split.column() + col.itemL(text="Velocity:") + sub = col.column(align=True) + sub.itemR(game, "minimum_velocity", text="Minimum") + sub.itemR(game, "maximum_velocity", text="Maximum") + + col.itemS() + + sub = col.column() + sub.active = (game.physics_type == 'RIGID_BODY') + sub.itemR(game, "anisotropic_friction") + subsub = sub.column() + subsub.active = game.anisotropic_friction + subsub.itemR(game, "friction_coefficients", text="", slider=True) + + layout.itemS() + + split = layout.split() + + col = split.column() + col.itemL(text="Lock Translation:") + col.itemR(game, "lock_x_axis", text="X") + col.itemR(game, "lock_y_axis", text="Y") + col.itemR(game, "lock_z_axis", text="Z") + + col = split.column() + col.itemL(text="Lock Rotation:") + col.itemR(game, "lock_x_rot_axis", text="X") + col.itemR(game, "lock_y_rot_axis", text="Y") + col.itemR(game, "lock_z_rot_axis", text="Z") - col = split.column() - col.itemL(text="Lock Rotation:") - col.itemR(game, "lock_x_rot_axis", text="X") - col.itemR(game, "lock_y_rot_axis", text="Y") - col.itemR(game, "lock_z_rot_axis", text="Z") + elif game.physics_type == 'SOFT_BODY': + col = layout.column() + col.itemR(game, "actor") + col.itemR(game, "ghost") + col.itemR(ob, "restrict_render", text="Invisible") + + layout.itemS() + + split = layout.split() + + col = split.column() + col.itemL(text="Attributes:") + col.itemR(game, "mass") + col.itemR(soft, "welding") + col.itemR(soft, "position_iterations") + col.itemR(soft, "linstiff", slider=True) + col.itemR(soft, "dynamic_friction", slider=True) + col.itemR(soft, "margin", slider=True) + col.itemR(soft, "bending_const", text="Bending Constraints") + + + col = split.column() + col.itemR(soft, "shape_match") + sub = col.column() + sub.active = soft.shape_match + sub.itemR(soft, "threshold", slider=True) + + col.itemS() + + col.itemL(text="Cluster Collision:") + col.itemR(soft, "enable_rs_collision", text="Rigid to Soft Body") + col.itemR(soft, "enable_ss_collision", text="Soft to Soft Body") + sub = col.column() + sub.active = (soft.enable_rs_collision or soft.enable_ss_collision) + sub.itemR(soft, "cluster_iterations", text="Iterations") + + elif game.physics_type == 'STATIC': + + col = layout.column() + col.itemR(game, "actor") + col.itemR(game, "ghost") + col.itemR(ob, "restrict_render", text="Invisible") + + elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'): + + col = layout.column() + col.itemR(ob, "restrict_render", text="Invisible") + class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel): __label__ = "Collision Bounds" + def poll(self, context): + ob = context.active_object + game = ob.game + return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) + def draw_header(self, context): layout = self.layout diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 056bd5d6c10..16abc3c91f6 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -210,13 +210,15 @@ class MATERIAL_PT_shadows(MaterialButtonsPanel): col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True) col = split.column() - col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias") + col.itemR(mat, "cast_buffer_shadows") sub = col.column() - subsub = sub.column() - subsub.active = (not mat.ray_shadow_bias) - subsub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias") - sub.itemR(mat, "cast_buffer_shadows") + sub.active = mat.cast_buffer_shadows sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias") + col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias") + sub = col.column() + sub.active = (not mat.ray_shadow_bias) + sub.itemR(mat, "shadow_ray_bias", text="Ray Bias") + class MATERIAL_PT_diffuse(MaterialButtonsPanel): __label__ = "Diffuse" diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py index d59ed604c55..5bd4bbbd6bd 100644 --- a/release/ui/buttons_object.py +++ b/release/ui/buttons_object.py @@ -51,7 +51,9 @@ class OBJECT_PT_relations(ObjectButtonsPanel): col.itemR(ob, "parent", text="") sub = col.column() - sub.itemR(ob, "parent_type", text="Type") + split = sub.split(percentage=0.3) + split.itemL(text="Type:") + split.itemR(ob, "parent_type", text="") parent = ob.parent if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE': sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="") diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py index 5ee6aba1f05..505fa57fa0b 100644 --- a/release/ui/buttons_object_constraint.py +++ b/release/ui/buttons_object_constraint.py @@ -361,9 +361,9 @@ class ConstraintButtonsPanel(bpy.types.Panel): def STRETCH_TO(self, layout, con): self.target_template(layout, con) - col = layout.column(align=True) - col.itemR(con, "original_length", text="Rest Length") - col.itemO("constraint.stretchto_reset") + row = layout.row() + row.itemR(con, "original_length", text="Rest Length") + row.itemO("constraint.stretchto_reset", text="Reset") col = layout.column() col.itemR(con, "bulge", text="Volume Variation") @@ -395,19 +395,21 @@ class ConstraintButtonsPanel(bpy.types.Panel): row = layout.row() row.itemR(con, "disable_linked_collision", text="No Collision") - row.itemR(con, "draw_pivot") + row.itemR(con, "draw_pivot", text="Display Pivot") split = layout.split() - col = split.column() - col.itemR(con, "pivot_x") - col.itemR(con, "pivot_y") - col.itemR(con, "pivot_z") + col = split.column(align=True) + col.itemL(text="Pivot:") + col.itemR(con, "pivot_x", text="X") + col.itemR(con, "pivot_y", text="Y") + col.itemR(con, "pivot_z", text="Z") - col = split.column() - col.itemR(con, "axis_x") - col.itemR(con, "axis_y") - col.itemR(con, "axis_z") + col = split.column(align=True) + col.itemL(text="Axis:") + col.itemR(con, "axis_x", text="X") + col.itemR(con, "axis_y", text="Y") + col.itemR(con, "axis_z", text="Z") #Missing: Limit arrays (not wrapped in RNA yet) diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index 62c720d09d1..7840a4946f2 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -55,8 +55,8 @@ class WORLD_PT_world(WorldButtonsPanel): if world: row = layout.row() - row.itemR(world, "blend_sky") row.itemR(world, "paper_sky") + row.itemR(world, "blend_sky") row.itemR(world, "real_sky") row = layout.row() @@ -83,10 +83,11 @@ class WORLD_PT_mist(WorldButtonsPanel): layout.active = world.mist.enabled flow = layout.column_flow() + flow.itemR(world.mist, "intensity", slider=True) flow.itemR(world.mist, "start") flow.itemR(world.mist, "depth") flow.itemR(world.mist, "height") - flow.itemR(world.mist, "intensity", slider=True) + layout.itemR(world.mist, "falloff") @@ -146,12 +147,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): col.itemL(text="Sampling:") col.itemR(ao, "sample_method", text="") - sub = col.column(align=True) + sub = col.column() sub.itemR(ao, "samples") if ao.sample_method == 'ADAPTIVE_QMC': sub.itemR(ao, "threshold") - sub.itemR(ao, "adapt_to_speed") + sub.itemR(ao, "adapt_to_speed", slider=True) elif ao.sample_method == 'CONSTANT_JITTERED': sub.itemR(ao, "bias") -- cgit v1.2.3