Merge from 2.5 r20991 through r21037
[blender.git] / release / ui / space_logic.py
1 import bpy
2
3 class LOGIC_PT_physics(bpy.types.Panel):
4         __space_type__ = "LOGIC_EDITOR"
5         __region_type__ = "UI"
6         __label__ = "Physics"
7
8         def draw(self, context):
9                 layout = self.layout
10                 ob = context.active_object
11                 
12                 game = ob.game
13
14                 flow = layout.column_flow()
15                 flow.active = True
16                 flow.itemR(game, "physics_type")
17                 flow.itemR(game, "actor")
18                 
19                 row = layout.row()
20                 row.itemR(game, "ghost")
21                 row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
22                 
23                 flow = layout.column_flow()
24                 flow.itemR(game, "mass")
25                 flow.itemR(game, "radius")
26                 flow.itemR(game, "no_sleeping")
27                 flow.itemR(game, "damping")
28                 flow.itemR(game, "rotation_damping")
29                 flow.itemR(game, "minimum_velocity")
30                 flow.itemR(game, "maximum_velocity")
31                 
32                 row = layout.row()
33                 row.itemR(game, "do_fh")
34                 row.itemR(game, "rotation_fh")
35                 
36                 flow = layout.column_flow()
37                 flow.itemR(game, "form_factor")
38                 flow.itemR(game, "anisotropic_friction")
39                 
40                 flow = layout.column_flow()
41                 flow.active = game.anisotropic_friction
42                 flow.itemR(game, "friction_coefficients")
43                 
44                 split = layout.split()
45                 sub = split.column()
46                 sub.itemR(game, "lock_x_axis")
47                 sub.itemR(game, "lock_y_axis")
48                 sub.itemR(game, "lock_z_axis")
49                 sub = split.column()
50                 sub.itemR(game, "lock_x_rot_axis")
51                 sub.itemR(game, "lock_y_rot_axis")
52                 sub.itemR(game, "lock_z_rot_axis")
53
54
55 class LOGIC_PT_collision_bounds(bpy.types.Panel):
56         __space_type__ = "LOGIC_EDITOR"
57         __region_type__ = "UI"
58         __label__ = "Collision Bounds"
59         
60         def draw_header(self, context):
61                 layout = self.layout
62                 ob = context.active_object
63                 game = ob.game
64
65                 layout.itemR(game, "use_collision_bounds", text="")
66         
67         def draw(self, context):
68                 layout = self.layout
69                 
70                 ob = context.scene.objects[0]
71                 game = ob.game
72                 
73                 flow = layout.column_flow()
74                 flow.active = game.use_collision_bounds
75                 flow.itemR(game, "collision_bounds")
76                 flow.itemR(game, "collision_compound")
77                 flow.itemR(game, "collision_margin")
78
79 bpy.types.register(LOGIC_PT_physics)
80 bpy.types.register(LOGIC_PT_collision_bounds)