2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
|
|
class DataButtonsPanel(bpy.types.Panel):
|
|
|
|
|
__space_type__ = "BUTTONS_WINDOW"
|
|
|
|
|
__region_type__ = "WINDOW"
|
|
|
|
|
__context__ = "data"
|
|
|
|
|
|
|
|
|
|
class DATA_PT_modifiers(DataButtonsPanel):
|
|
|
|
|
__idname__ = "DATA_PT_modifiers"
|
|
|
|
|
__label__ = "Modifiers"
|
2009-05-04 15:53:55 +00:00
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
|
ob = context.active_object
|
2009-05-04 18:45:58 +00:00
|
|
|
return (ob and ob.type in ("MESH", "CURVE", "SURFACE", "TEXT", "LATTICE"))
|
2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
if not ob:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
|
layout.item_menu_enumO("OBJECT_OT_modifier_add", "type")
|
|
|
|
|
|
|
|
|
|
for md in ob.modifiers:
|
|
|
|
|
sub = layout.box()
|
|
|
|
|
|
|
|
|
|
sub.row()
|
|
|
|
|
sub.itemR(md, "expanded", text="")
|
|
|
|
|
sub.itemR(md, "name", text="")
|
|
|
|
|
|
|
|
|
|
sub.itemR(md, "render", text="")
|
|
|
|
|
sub.itemR(md, "realtime", text="")
|
|
|
|
|
sub.itemR(md, "editmode", text="")
|
|
|
|
|
sub.itemR(md, "on_cage", text="")
|
|
|
|
|
|
|
|
|
|
if md.expanded:
|
|
|
|
|
sub.row()
|
|
|
|
|
sub.itemS()
|
|
|
|
|
|
|
|
|
|
if md.type == "ARMATURE":
|
|
|
|
|
self.armature(sub, md)
|
|
|
|
|
|
|
|
|
|
def armature(self, layout, md):
|
|
|
|
|
layout.column()
|
|
|
|
|
layout.itemR(md, "object")
|
|
|
|
|
layout.row()
|
|
|
|
|
layout.itemR(md, "vertex_group")
|
|
|
|
|
layout.itemR(md, "invert")
|
|
|
|
|
layout.column_flow()
|
|
|
|
|
layout.itemR(md, "use_vertex_groups")
|
|
|
|
|
layout.itemR(md, "use_bone_envelopes")
|
|
|
|
|
layout.itemR(md, "quaternion")
|
|
|
|
|
layout.itemR(md, "b_bone_rest")
|
|
|
|
|
layout.itemR(md, "multi_modifier")
|
|
|
|
|
|
2009-05-04 15:53:55 +00:00
|
|
|
class DATA_PT_cameralens(DataButtonsPanel):
|
|
|
|
|
__idname__ = "DATA_PT_camera"
|
|
|
|
|
__label__ = "Lens"
|
|
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
return (ob and ob.type == "CAMERA")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
cam = context.main.cameras[0]
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
if not cam:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
|
layout.itemR(cam, "type", expand=True)
|
|
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
|
if cam.type == 'PERSP':
|
|
|
|
|
layout.itemR(cam, "lens_unit")
|
|
|
|
|
if cam.lens_unit == 'MILLIMETERS':
|
|
|
|
|
layout.itemR(cam, "lens", text="Angle")
|
|
|
|
|
if cam.lens_unit == 'DEGREES':
|
|
|
|
|
layout.itemR(cam, "angle")
|
|
|
|
|
if cam.type == 'ORTHO':
|
|
|
|
|
layout.itemR(cam, "ortho_scale")
|
|
|
|
|
|
|
|
|
|
layout.column_flow()
|
|
|
|
|
layout.itemL(text="Shift:")
|
|
|
|
|
layout.itemR(cam, "shift_x", text="X")
|
|
|
|
|
layout.itemR(cam, "shift_y", text="Y")
|
|
|
|
|
layout.itemL(text="Clipping:")
|
|
|
|
|
layout.itemR(cam, "clip_start", text="Start")
|
|
|
|
|
layout.itemR(cam, "clip_end", text="End")
|
|
|
|
|
|
|
|
|
|
layout.row()
|
|
|
|
|
layout.itemR(cam, "dof_object")
|
|
|
|
|
layout.itemR(cam, "dof_distance")
|
|
|
|
|
|
|
|
|
|
class DATA_PT_cameradisplay(DataButtonsPanel):
|
|
|
|
|
__idname__ = "DATA_PT_cameradisplay"
|
|
|
|
|
__label__ = "Display"
|
|
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
return (ob and ob.type == "CAMERA")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
cam = context.main.cameras[0]
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
if not cam:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
layout.split(number=2)
|
|
|
|
|
|
|
|
|
|
sub = layout.sub(0)
|
2009-05-05 04:07:08 +00:00
|
|
|
sub.column()
|
2009-05-04 15:53:55 +00:00
|
|
|
sub.itemR(cam, "show_limits", text="Limits")
|
|
|
|
|
sub.itemR(cam, "show_mist", text="Mist")
|
|
|
|
|
sub.itemR(cam, "show_title_safe", text="Title Safe")
|
|
|
|
|
sub.itemR(cam, "show_name", text="Name")
|
|
|
|
|
|
|
|
|
|
sub = layout.sub(1)
|
|
|
|
|
subsub = sub.box()
|
2009-05-05 04:07:08 +00:00
|
|
|
subsub.column()
|
2009-05-04 15:53:55 +00:00
|
|
|
subsub.itemR(cam, "show_passepartout", text="Passepartout")
|
2009-05-05 04:07:08 +00:00
|
|
|
if (cam.show_passepartout):
|
|
|
|
|
subsub.itemR(cam, "passepartout_alpha", text="Alpha")
|
2009-05-04 15:53:55 +00:00
|
|
|
sub.row()
|
|
|
|
|
sub.itemR(cam, "draw_size", text="Size")
|
|
|
|
|
|
2009-04-27 18:05:58 +00:00
|
|
|
bpy.types.register(DATA_PT_modifiers)
|
2009-05-04 15:53:55 +00:00
|
|
|
bpy.types.register(DATA_PT_cameralens)
|
|
|
|
|
bpy.types.register(DATA_PT_cameradisplay)
|
2009-04-27 18:05:58 +00:00
|
|
|
|