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.
This commit is contained in:
2009-08-12 22:16:47 +00:00
parent 78c2330550
commit 44ca632ce7
7 changed files with 163 additions and 90 deletions

View File

@@ -106,12 +106,15 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
row.itemR(group, "name") row.itemR(group, "name")
if context.edit_object: if context.edit_object:
row = layout.row(align=True) row = layout.row()
row.itemO("object.vertex_group_assign", text="Assign") sub = row.row(align=True)
row.itemO("object.vertex_group_remove_from", text="Remove") sub.itemO("object.vertex_group_assign", text="Assign")
row.itemO("object.vertex_group_select", text="Select") sub.itemO("object.vertex_group_remove_from", text="Remove")
row.itemO("object.vertex_group_deselect", text="Deselect")
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") 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) row.itemR(kb, "value", slider=True)
split = layout.split() split = layout.split()
sub = split.column() sub = split.column(align=True)
sub.enabled = ob.shape_key_lock == False sub.enabled = ob.shape_key_lock == False
sub.itemL(text="Range:") sub.itemL(text="Range:")
sub.itemR(kb, "slider_min", text="Min") sub.itemR(kb, "slider_min", text="Min")

View File

@@ -333,7 +333,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.itemL(text="See Soft Body panel.") layout.itemL(text="See Soft Body panel.")
def SUBSURF(self, layout, ob, md): def SUBSURF(self, layout, ob, md):
layout.itemR(md, "subdivision_type") layout.row().itemR(md, "subdivision_type", expand=True)
flow = layout.column_flow() flow = layout.column_flow()
flow.itemR(md, "levels", text="Preview") 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.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
#layout.itemR(md, "projectors") #layout.itemR(md, "projectors")
layout.itemR(md, "image") layout.itemR(md, "image")
layout.itemR(md, "horizontal_aspect_ratio")
layout.itemR(md, "vertical_aspect_ratio")
layout.itemR(md, "override_image") 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. #"Projectors" don't work.
def WAVE(self, layout, ob, md): def WAVE(self, layout, ob, md):

View File

@@ -19,10 +19,14 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
ob = context.active_object ob = context.active_object
game = ob.game game = ob.game
soft = ob.game.soft_body
layout.itemR(game, "physics_type") layout.itemR(game, "physics_type")
layout.itemS() layout.itemS()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -41,7 +45,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col = split.column() col = split.column()
col.itemL(text="Attributes:") col.itemL(text="Attributes:")
sub = col.column(align=True) sub = col.column()
sub.itemR(game, "mass") sub.itemR(game, "mass")
sub.itemR(game, "radius") sub.itemR(game, "radius")
sub.itemR(game, "form_factor") sub.itemR(game, "form_factor")
@@ -61,10 +65,12 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemS() col.itemS()
col.itemR(game, "anisotropic_friction")
sub = col.column() sub = col.column()
sub.active = game.anisotropic_friction sub.active = (game.physics_type == 'RIGID_BODY')
sub.itemR(game, "friction_coefficients", text="", slider=True) sub.itemR(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
subsub.itemR(game, "friction_coefficients", text="", slider=True)
layout.itemS() layout.itemS()
@@ -82,9 +88,63 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemR(game, "lock_y_rot_axis", text="Y") col.itemR(game, "lock_y_rot_axis", text="Y")
col.itemR(game, "lock_z_rot_axis", text="Z") 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): class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds" __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): def draw_header(self, context):
layout = self.layout layout = self.layout

View File

@@ -210,13 +210,15 @@ class MATERIAL_PT_shadows(MaterialButtonsPanel):
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True) col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
col = split.column() col = split.column()
col.itemR(mat, "cast_buffer_shadows")
sub = col.column()
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") col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
sub = col.column() sub = col.column()
subsub = sub.column() sub.active = (not mat.ray_shadow_bias)
subsub.active = (not mat.ray_shadow_bias) sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
subsub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias")
sub.itemR(mat, "cast_buffer_shadows")
sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel): class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse" __label__ = "Diffuse"

View File

@@ -51,7 +51,9 @@ class OBJECT_PT_relations(ObjectButtonsPanel):
col.itemR(ob, "parent", text="") col.itemR(ob, "parent", text="")
sub = col.column() 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 parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE': if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="") sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")

View File

@@ -361,9 +361,9 @@ class ConstraintButtonsPanel(bpy.types.Panel):
def STRETCH_TO(self, layout, con): def STRETCH_TO(self, layout, con):
self.target_template(layout, con) self.target_template(layout, con)
col = layout.column(align=True) row = layout.row()
col.itemR(con, "original_length", text="Rest Length") row.itemR(con, "original_length", text="Rest Length")
col.itemO("constraint.stretchto_reset") row.itemO("constraint.stretchto_reset", text="Reset")
col = layout.column() col = layout.column()
col.itemR(con, "bulge", text="Volume Variation") col.itemR(con, "bulge", text="Volume Variation")
@@ -395,19 +395,21 @@ class ConstraintButtonsPanel(bpy.types.Panel):
row = layout.row() row = layout.row()
row.itemR(con, "disable_linked_collision", text="No Collision") 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() split = layout.split()
col = split.column() col = split.column(align=True)
col.itemR(con, "pivot_x") col.itemL(text="Pivot:")
col.itemR(con, "pivot_y") col.itemR(con, "pivot_x", text="X")
col.itemR(con, "pivot_z") col.itemR(con, "pivot_y", text="Y")
col.itemR(con, "pivot_z", text="Z")
col = split.column() col = split.column(align=True)
col.itemR(con, "axis_x") col.itemL(text="Axis:")
col.itemR(con, "axis_y") col.itemR(con, "axis_x", text="X")
col.itemR(con, "axis_z") col.itemR(con, "axis_y", text="Y")
col.itemR(con, "axis_z", text="Z")
#Missing: Limit arrays (not wrapped in RNA yet) #Missing: Limit arrays (not wrapped in RNA yet)

View File

@@ -55,8 +55,8 @@ class WORLD_PT_world(WorldButtonsPanel):
if world: if world:
row = layout.row() row = layout.row()
row.itemR(world, "blend_sky")
row.itemR(world, "paper_sky") row.itemR(world, "paper_sky")
row.itemR(world, "blend_sky")
row.itemR(world, "real_sky") row.itemR(world, "real_sky")
row = layout.row() row = layout.row()
@@ -83,10 +83,11 @@ class WORLD_PT_mist(WorldButtonsPanel):
layout.active = world.mist.enabled layout.active = world.mist.enabled
flow = layout.column_flow() flow = layout.column_flow()
flow.itemR(world.mist, "intensity", slider=True)
flow.itemR(world.mist, "start") flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth") flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height") flow.itemR(world.mist, "height")
flow.itemR(world.mist, "intensity", slider=True)
layout.itemR(world.mist, "falloff") layout.itemR(world.mist, "falloff")
@@ -146,12 +147,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
col.itemL(text="Sampling:") col.itemL(text="Sampling:")
col.itemR(ao, "sample_method", text="") col.itemR(ao, "sample_method", text="")
sub = col.column(align=True) sub = col.column()
sub.itemR(ao, "samples") sub.itemR(ao, "samples")
if ao.sample_method == 'ADAPTIVE_QMC': if ao.sample_method == 'ADAPTIVE_QMC':
sub.itemR(ao, "threshold") sub.itemR(ao, "threshold")
sub.itemR(ao, "adapt_to_speed") sub.itemR(ao, "adapt_to_speed", slider=True)
elif ao.sample_method == 'CONSTANT_JITTERED': elif ao.sample_method == 'CONSTANT_JITTERED':
sub.itemR(ao, "bias") sub.itemR(ao, "bias")