4 class DataButtonsPanel(bpy.types.Panel):
5 __space_type__ = "BUTTONS_WINDOW"
6 __region_type__ = "WINDOW"
9 class DATA_PT_modifiers(DataButtonsPanel):
10 __idname__ = "DATA_PT_modifiers"
11 __label__ = "Modifiers"
13 def poll(self, context):
14 ob = context.active_object
15 return (ob and ob.type in ("MESH", "CURVE", "SURFACE", "TEXT", "LATTICE"))
17 def draw(self, context):
18 ob = context.active_object
25 layout.item_menu_enumO("OBJECT_OT_modifier_add", "type")
27 for md in ob.modifiers:
31 sub.itemR(md, "expanded", text="")
32 sub.itemR(md, "name", text="")
34 sub.itemR(md, "render", text="")
35 sub.itemR(md, "realtime", text="")
36 sub.itemR(md, "editmode", text="")
37 sub.itemR(md, "on_cage", text="")
43 if md.type == "ARMATURE":
44 self.armature(sub, md)
46 def armature(self, layout, md):
48 layout.itemR(md, "object")
50 layout.itemR(md, "vertex_group")
51 layout.itemR(md, "invert")
53 layout.itemR(md, "use_vertex_groups")
54 layout.itemR(md, "use_bone_envelopes")
55 layout.itemR(md, "quaternion")
56 layout.itemR(md, "b_bone_rest")
57 layout.itemR(md, "multi_modifier")
59 class DATA_PT_cameralens(DataButtonsPanel):
60 __idname__ = "DATA_PT_camera"
63 def poll(self, context):
64 ob = context.active_object
65 return (ob and ob.type == "CAMERA")
67 def draw(self, context):
68 cam = context.main.cameras[0]
75 layout.itemR(cam, "type", expand=True)
78 if cam.type == 'PERSP':
79 layout.itemR(cam, "lens_unit")
80 if cam.lens_unit == 'MILLIMETERS':
81 layout.itemR(cam, "lens", text="Angle")
82 if cam.lens_unit == 'DEGREES':
83 layout.itemR(cam, "angle")
84 if cam.type == 'ORTHO':
85 layout.itemR(cam, "ortho_scale")
88 layout.itemL(text="Shift:")
89 layout.itemR(cam, "shift_x", text="X")
90 layout.itemR(cam, "shift_y", text="Y")
91 layout.itemL(text="Clipping:")
92 layout.itemR(cam, "clip_start", text="Start")
93 layout.itemR(cam, "clip_end", text="End")
96 layout.itemR(cam, "dof_object")
97 layout.itemR(cam, "dof_distance")
99 class DATA_PT_cameradisplay(DataButtonsPanel):
100 __idname__ = "DATA_PT_cameradisplay"
101 __label__ = "Display"
103 def poll(self, context):
104 ob = context.active_object
105 return (ob and ob.type == "CAMERA")
107 def draw(self, context):
108 cam = context.main.cameras[0]
114 layout.split(number=2)
118 sub.itemR(cam, "show_limits", text="Limits")
119 sub.itemR(cam, "show_mist", text="Mist")
120 sub.itemR(cam, "show_title_safe", text="Title Safe")
121 sub.itemR(cam, "show_name", text="Name")
126 subsub.itemR(cam, "show_passepartout", text="Passepartout")
127 if (cam.show_passepartout):
128 subsub.itemR(cam, "passepartout_alpha", text="Alpha")
130 sub.itemR(cam, "draw_size", text="Size")
132 bpy.types.register(DATA_PT_modifiers)
133 bpy.types.register(DATA_PT_cameralens)
134 bpy.types.register(DATA_PT_cameradisplay)