4 class GameButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 class GAME_PT_context_game(GameButtonsPanel):
10 __idname__ = "GAME_PT_context_game"
13 def draw(self, context):
18 split = layout.split(percentage=0.06)
19 split.itemL(text="", icon="ICON_GAME")
20 split.itemR(game, "name", text="")
22 class GAME_PT_data(GameButtonsPanel):
23 __idname__ = "GAME_PT_data"
26 def draw(self, context):
31 class GAME_PT_physics(GameButtonsPanel):
32 __idname__ = "GAME_PT_physics"
35 def poll(self, context):
36 ob = context.active_object
39 def draw(self, context):
41 ob = context.active_object
45 flow = layout.column_flow()
47 flow.itemR(game, "physics_type")
48 flow.itemR(game, "actor")
51 row.itemR(game, "ghost")
52 row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
54 flow = layout.column_flow()
55 flow.itemR(game, "mass")
56 flow.itemR(game, "radius")
57 flow.itemR(game, "no_sleeping")
58 flow.itemR(game, "damping")
59 flow.itemR(game, "rotation_damping")
60 flow.itemR(game, "minimum_velocity")
61 flow.itemR(game, "maximum_velocity")
64 row.itemR(game, "do_fh")
65 row.itemR(game, "rotation_fh")
67 flow = layout.column_flow()
68 flow.itemR(game, "form_factor")
69 flow.itemR(game, "anisotropic_friction")
71 flow = layout.column_flow()
72 flow.active = game.anisotropic_friction
73 flow.itemR(game, "friction_coefficients")
75 split = layout.split()
77 sub.itemR(game, "lock_x_axis")
78 sub.itemR(game, "lock_y_axis")
79 sub.itemR(game, "lock_z_axis")
81 sub.itemR(game, "lock_x_rot_axis")
82 sub.itemR(game, "lock_y_rot_axis")
83 sub.itemR(game, "lock_z_rot_axis")
86 class GAME_PT_collision_bounds(GameButtonsPanel):
87 __idname__ = "GAME_PT_collision_bounds"
88 __label__ = "Collision Bounds"
90 def poll(self, context):
91 ob = context.active_object
94 def draw_header(self, context):
96 ob = context.active_object
99 layout.itemR(game, "use_collision_bounds", text="")
101 def draw(self, context):
104 ob = context.scene.objects[0]
107 flow = layout.column_flow()
108 flow.active = game.use_collision_bounds
109 flow.itemR(game, "collision_bounds")
110 flow.itemR(game, "collision_compound")
111 flow.itemR(game, "collision_margin")
115 bpy.types.register(GAME_PT_context_game)
116 bpy.types.register(GAME_PT_data)
117 bpy.types.register(GAME_PT_physics)
118 bpy.types.register(GAME_PT_collision_bounds)