3 class LOGIC_PT_physics(bpy.types.Panel):
4 __space_type__ = "LOGIC_EDITOR"
8 def poll(self, context):
9 ob = context.active_object
12 def draw(self, context):
14 ob = context.active_object
18 flow = layout.column_flow()
20 flow.itemR(game, "physics_type")
21 flow.itemR(game, "actor")
24 row.itemR(game, "ghost")
25 row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
27 flow = layout.column_flow()
28 flow.itemR(game, "mass")
29 flow.itemR(game, "radius")
30 flow.itemR(game, "no_sleeping")
31 flow.itemR(game, "damping")
32 flow.itemR(game, "rotation_damping")
33 flow.itemR(game, "minimum_velocity")
34 flow.itemR(game, "maximum_velocity")
37 row.itemR(game, "do_fh")
38 row.itemR(game, "rotation_fh")
40 flow = layout.column_flow()
41 flow.itemR(game, "form_factor")
42 flow.itemR(game, "anisotropic_friction")
44 flow = layout.column_flow()
45 flow.active = game.anisotropic_friction
46 flow.itemR(game, "friction_coefficients")
48 split = layout.split()
50 sub.itemR(game, "lock_x_axis")
51 sub.itemR(game, "lock_y_axis")
52 sub.itemR(game, "lock_z_axis")
54 sub.itemR(game, "lock_x_rot_axis")
55 sub.itemR(game, "lock_y_rot_axis")
56 sub.itemR(game, "lock_z_rot_axis")
59 class LOGIC_PT_collision_bounds(bpy.types.Panel):
60 __space_type__ = "LOGIC_EDITOR"
61 __region_type__ = "UI"
62 __label__ = "Collision Bounds"
64 def poll(self, context):
65 ob = context.active_object
68 def draw_header(self, context):
70 ob = context.active_object
73 layout.itemR(game, "use_collision_bounds", text="")
75 def draw(self, context):
78 ob = context.active_object
81 flow = layout.column_flow()
82 flow.active = game.use_collision_bounds
83 flow.itemR(game, "collision_bounds")
84 flow.itemR(game, "collision_compound")
85 flow.itemR(game, "collision_margin")
87 class LOGIC_PT_properties(bpy.types.Panel):
88 __space_type__ = "LOGIC_EDITOR"
89 __region_type__ = "UI"
90 __label__ = "Properties"
92 def poll(self, context):
93 ob = context.active_object
96 def draw(self, context):
99 ob = context.active_object
102 for prop in game.properties:
104 flow.itemR(prop, "name", text="")
105 flow.itemR(prop, "type", text="")
106 flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
107 flow.itemR(prop, "debug")
109 bpy.types.register(LOGIC_PT_physics)
110 bpy.types.register(LOGIC_PT_collision_bounds)
111 bpy.types.register(LOGIC_PT_properties)