undo previous commit, changing running the script to importing it somehow made it...
[blender.git] / release / ui / buttons_objects.py
1 # import bpy
2
3 class OBJECT_PT_transform(bpy.types.Panel):
4         __label__ = "Transform"
5         __context__ = "object"
6
7         def draw(self, context):
8                 ob = context.active_object
9                 layout = self.layout
10
11                 if not ob:
12                         return
13
14                 layout.template_column_flow(3)
15                 layout.itemR(ob, "location")
16                 layout.itemR(ob, "rotation")
17                 layout.itemR(ob, "scale")
18
19 class OBJECT_PT_groups(bpy.types.Panel):
20         __label__ = "Groups"
21         __context__ = "object"
22
23         def draw(self, context):
24                 ob = context.active_object
25                 layout = self.layout
26
27                 if not ob:
28                         return
29
30                 layout.template_column_flow(2)
31                 layout.itemR(ob, "pass_index")
32                 layout.itemR(ob, "parent")
33
34                 # layout.template_left_right()
35                 # layout.itemO("OBJECT_OT_add_group");
36
37                 for group in bpy.data.groups:
38                         if ob in group.objects:
39                                 sublayout = layout.template_stack()
40
41                                 sublayout.template_left_right()
42                                 sublayout.itemR(group, "name")
43                                 # sublayout.itemO("OBJECT_OT_remove_group")
44
45                                 sublayout.template_column_flow(2)
46                                 sublayout.itemR(group, "layer")
47                                 sublayout.itemR(group, "dupli_offset")
48
49 class OBJECT_PT_display(bpy.types.Panel):
50         __label__ = "Display"
51         __context__ = "object"
52
53         def draw(self, context):
54                 ob = context.active_object
55                 layout = self.layout
56
57                 if not ob:
58                         return
59
60                 layout.template_column_flow(2)
61                 layout.itemR(ob, "max_draw_type", text="Type")
62                 layout.itemR(ob, "draw_bounds_type", text="Bounds")
63
64                 layout.template_column_flow(2)
65                 layout.itemR(ob, "draw_name", text="Name")
66                 layout.itemR(ob, "draw_axis", text="Axis")
67                 layout.itemR(ob, "draw_wire", text="Wire")
68                 layout.itemR(ob, "draw_texture_space", text="Texture Space")
69                 layout.itemR(ob, "x_ray", text="X-Ray")
70                 layout.itemR(ob, "draw_transparent", text="Transparency")
71
72 class OBJECT_PT_duplication(bpy.types.Panel):
73         __label__ = "Duplication"
74         __context__ = "object"
75
76         def draw(self, context):
77                 ob = context.active_object
78                 layout = self.layout
79
80                 if not ob:
81                         return
82
83                 layout.template_column()
84                 layout.itemR(ob, "dupli_type", text="")
85
86                 if ob.dupli_type == "FRAMES":
87                         layout.template_column_flow(2)
88                         layout.itemR(ob, "dupli_frames_start", text="Start:")
89                         layout.itemR(ob, "dupli_frames_end", text="End:")
90                         layout.itemR(ob, "dupli_frames_on", text="On:")
91                         layout.itemR(ob, "dupli_frames_off", text="Off:")
92
93 class OBJECT_PT_animation(bpy.types.Panel):
94         __label__ = "Animation"
95         __context__ = "object"
96
97         def draw(self, context):
98                 ob = context.active_object
99                 layout = self.layout
100
101                 if not ob:
102                         return
103
104                 layout.template_column()
105                 
106                 layout.template_slot("COLUMN_1")
107                 layout.itemL(text="Time Offset:")
108                 layout.itemR(ob, "time_offset_edit", text="Edit")
109                 layout.itemR(ob, "time_offset_particle", text="Particle")
110                 layout.itemR(ob, "time_offset_parent", text="Parent")
111                 layout.itemR(ob, "slow_parent")
112                 layout.itemR(ob, "time_offset", text="Offset:")
113                 
114                 layout.template_slot("COLUMN_2")
115                 layout.itemL(text="Tracking:")
116                 layout.itemR(ob, "track_axis", text="Axis")
117                 layout.itemR(ob, "up_axis", text="Up Axis")
118                 layout.itemR(ob, "track_rotation", text="Rotation")
119
120 bpy.ui.addPanel(OBJECT_PT_transform, "BUTTONS_WINDOW", "WINDOW")
121 bpy.ui.addPanel(OBJECT_PT_groups, "BUTTONS_WINDOW", "WINDOW")
122 bpy.ui.addPanel(OBJECT_PT_display, "BUTTONS_WINDOW", "WINDOW")
123 bpy.ui.addPanel(OBJECT_PT_duplication, "BUTTONS_WINDOW", "WINDOW")
124 bpy.ui.addPanel(OBJECT_PT_animation, "BUTTONS_WINDOW", "WINDOW")