[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22420] branches/blender2.5/blender/ release/ui: Added game soft body settings, and cleaned up layout there slightly.
William Reynish
william at reynish.com
Thu Aug 13 00:16:47 CEST 2009
Revision: 22420
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22420
Author: billrey
Date: 2009-08-13 00:16:47 +0200 (Thu, 13 Aug 2009)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/buttons_data_mesh.py
branches/blender2.5/blender/release/ui/buttons_data_modifier.py
branches/blender2.5/blender/release/ui/buttons_game.py
branches/blender2.5/blender/release/ui/buttons_material.py
branches/blender2.5/blender/release/ui/buttons_object.py
branches/blender2.5/blender/release/ui/buttons_object_constraint.py
branches/blender2.5/blender/release/ui/buttons_world.py
Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-08-12 21:38:23 UTC (rev 22419)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-08-12 22:16:47 UTC (rev 22420)
@@ -106,13 +106,16 @@
row.itemR(group, "name")
if context.edit_object:
- row = layout.row(align=True)
+ 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")
- 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")
-
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(DataButtonsPanel):
@@ -159,7 +162,7 @@
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")
Modified: branches/blender2.5/blender/release/ui/buttons_data_modifier.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-08-12 21:38:23 UTC (rev 22419)
+++ branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-08-12 22:16:47 UTC (rev 22420)
@@ -333,7 +333,7 @@
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 @@
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):
Modified: branches/blender2.5/blender/release/ui/buttons_game.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_game.py 2009-08-12 21:38:23 UTC (rev 22419)
+++ branches/blender2.5/blender/release/ui/buttons_game.py 2009-08-12 22:16:47 UTC (rev 22420)
@@ -19,72 +19,132 @@
ob = context.active_object
game = ob.game
+ soft = ob.game.soft_body
layout.itemR(game, "physics_type")
layout.itemS()
- split = layout.split()
+ #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.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+ 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")
- 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")
-
- 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 == '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
Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py 2009-08-12 21:38:23 UTC (rev 22419)
+++ branches/blender2.5/blender/release/ui/buttons_material.py 2009-08-12 22:16:47 UTC (rev 22420)
@@ -210,13 +210,15 @@
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha", slider=True)
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")
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.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
+ sub.active = (not mat.ray_shadow_bias)
+ sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
+
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse"
Modified: branches/blender2.5/blender/release/ui/buttons_object.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_object.py 2009-08-12 21:38:23 UTC (rev 22419)
+++ branches/blender2.5/blender/release/ui/buttons_object.py 2009-08-12 22:16:47 UTC (rev 22420)
@@ -51,7 +51,9 @@
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="")
Modified: branches/blender2.5/blender/release/ui/buttons_object_constraint.py
===================================================================
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list