diff options
Diffstat (limited to 'release/ui/buttons_game.py')
-rw-r--r-- | release/ui/buttons_game.py | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index 73ba566e23f..7334b453e91 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -2,8 +2,8 @@ import bpy class PhysicsButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "physics" def poll(self, context): @@ -45,9 +45,10 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): col = split.column() col.itemL(text="Attributes:") - col.itemR(game, "mass") - col.itemR(game, "radius") - col.itemR(game, "form_factor") + sub = col.column() + sub.itemR(game, "mass") + sub.itemR(game, "radius") + sub.itemR(game, "form_factor") col = split.column() sub = col.column() @@ -107,7 +108,8 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): 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() @@ -132,26 +134,32 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'): - layout.itemR(ob, "restrict_render", text="Invisible") + col = layout.column() + col.itemR(ob, "restrict_render", text="Invisible") class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel): __label__ = "Collision Bounds" def poll(self, context): - game = context.object.game + ob = context.active_object + game = ob.game rd = context.scene.render_data return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME') def draw_header(self, context): - game = context.active_object.game + layout = self.layout + + ob = context.active_object + game = ob.game - self.layout.itemR(game, "use_collision_bounds", text="") + layout.itemR(game, "use_collision_bounds", text="") def draw(self, context): layout = self.layout - game = context.active_object.game - + ob = context.scene.objects[0] + game = ob.game + layout.active = game.use_collision_bounds layout.itemR(game, "collision_bounds", text="Bounds") @@ -163,8 +171,8 @@ bpy.types.register(PHYSICS_PT_game_physics) bpy.types.register(PHYSICS_PT_game_collision_bounds) class SceneButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "scene" def poll(self, context): @@ -176,6 +184,8 @@ class SCENE_PT_game(SceneButtonsPanel): def draw(self, context): layout = self.layout + + rd = context.scene.render_data row = layout.row() row.itemO("view3d.game_start", text="Start") @@ -312,8 +322,8 @@ bpy.types.register(SCENE_PT_game_shading) bpy.types.register(SCENE_PT_game_performance) class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = 'PROPERTIES' - __region_type__ = 'WINDOW' + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" __context__ = "world" def poll(self, context): |