Added game soft body settings, and cleaned up layout there slightly.
authorWilliam Reynish <william@reynish.com>
Wed, 12 Aug 2009 22:16:47 +0000 (22:16 +0000)
committerWilliam Reynish <william@reynish.com>
Wed, 12 Aug 2009 22:16:47 +0000 (22:16 +0000)
Also converted some other percentage properties to use sliders, and a few other small layout tweaks.

release/ui/buttons_data_mesh.py
release/ui/buttons_data_modifier.py
release/ui/buttons_game.py
release/ui/buttons_material.py
release/ui/buttons_object.py
release/ui/buttons_object_constraint.py
release/ui/buttons_world.py

index 3930d1029da705b5a4df8b4a74dc457a3348feaf..d6ca0817edcd497d6f4c4deee26c848d30c12fa6 100644 (file)
@@ -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")
index 63204cfbc3dac76e43296d60b67437df7b3da01b..6dd11457ec9e411666d701a92b6d64d154e8bbc7 100644 (file)
@@ -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):
index ee6260202e89db390d42c6dd1573fc78c4e3e964..6d53b6a532782217601eec41f13710999af567e0 100644 (file)
@@ -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
                
index 056bd5d6c10a929719f1bebbf17638b4ff51e703..16abc3c91f63ac0849b2f9cbb791abae6c9e6485 100644 (file)
@@ -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"
index d59ed604c55f034569258ea7d4f07a85794c9880..5bd4bbbd6bdffa8ee0d6950f7cd7e7af85150b57 100644 (file)
@@ -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="")
index 5ee6aba1f0589000b515172738e450af37deeeae..505fa57fa0b96e9125a942cd760547d80ece1d96 100644 (file)
@@ -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) 
        
index 62c720d09d1988bf105c8e07e99c28452a489448..7840a4946f25b290b44e5c115d4f1f53842656f1 100644 (file)
@@ -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")