4 class ObjectButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 def poll(self, context):
10 return (context.active_object != None)
12 class OBJECT_PT_transform(ObjectButtonsPanel):
13 __idname__ = "OBJECT_PT_transform"
14 __label__ = "Transform"
16 def draw(self, context):
17 ob = context.active_object
21 layout.itemR(ob, "location")
22 layout.itemR(ob, "rotation")
23 layout.itemR(ob, "scale")
25 class OBJECT_PT_groups(ObjectButtonsPanel):
26 __idname__ = "OBJECT_PT_groups"
29 def draw(self, context):
30 ob = context.active_object
34 layout.itemR(ob, "pass_index")
35 layout.itemR(ob, "parent")
38 # layout.itemO("OBJECT_OT_add_group");
40 for group in bpy.data.groups:
41 if ob in group.objects:
44 sub.split(number=2, lr=True)
45 sub.sub(0).itemR(group, "name")
46 # sub.sub(1).itemO("OBJECT_OT_remove_group")
49 sub.itemR(group, "layer")
50 sub.itemR(group, "dupli_offset")
52 class OBJECT_PT_display(ObjectButtonsPanel):
53 __idname__ = "OBJECT_PT_display"
56 def draw(self, context):
57 ob = context.active_object
61 layout.itemR(ob, "max_draw_type", text="Type")
62 layout.itemR(ob, "draw_bounds_type", text="Bounds")
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")
72 class OBJECT_PT_duplication(ObjectButtonsPanel):
73 __idname__ = "OBJECT_PT_duplication"
74 __label__ = "Duplication"
76 def draw(self, context):
77 ob = context.active_object
81 layout.itemR(ob, "dupli_type", text="", expand=True)
83 if ob.dupli_type == "FRAMES":
85 layout.itemR(ob, "dupli_frames_start", text="Start")
86 layout.itemR(ob, "dupli_frames_end", text="End")
87 layout.itemR(ob, "dupli_frames_on", text="On")
88 layout.itemR(ob, "dupli_frames_off", text="Off")
90 class OBJECT_PT_animation(ObjectButtonsPanel):
91 __idname__ = "OBJECT_PT_animation"
92 __label__ = "Animation"
94 def draw(self, context):
95 ob = context.active_object
98 layout.split(number=2)
102 sub.itemL(text="Time Offset:")
103 sub.itemR(ob, "time_offset_edit", text="Edit")
104 sub.itemR(ob, "time_offset_particle", text="Particle")
105 sub.itemR(ob, "time_offset_parent", text="Parent")
106 sub.itemR(ob, "slow_parent")
107 sub.itemR(ob, "time_offset", text="Offset")
111 sub.itemL(text="Tracking:")
112 sub.itemR(ob, "track_axis", text="Axis")
113 sub.itemR(ob, "up_axis", text="Up Axis")
114 sub.itemR(ob, "track_rotation", text="Rotation")
116 bpy.types.register(OBJECT_PT_transform)
117 bpy.types.register(OBJECT_PT_groups)
118 bpy.types.register(OBJECT_PT_display)
119 bpy.types.register(OBJECT_PT_duplication)
120 bpy.types.register(OBJECT_PT_animation)