blender/release/ui/buttons_data_camera.py
Brecht Van Lommel 41fb3626f3 2.5: Render
* UI layout for scene buttons has quite some changes, I tried to
  better organize things according to the pipeline, and also showing
  important properties by default, and collapsing less important ones.

Some changes compared to 2.4x:
* Panorama is now a Camera property.
* Sequence and Compositing are now enabled by default, but will only
  do something when there is a node tree using nodes, or a strip in the
  sequence editor.
* Enabling Full Sample now automatically enables Save Buffers too.
* Stamp option to include info in file is removed, it now simply always
  does this if one of the stamp infos is enabled.
* Xvid, H.264 and Ogg Theora are now directly in the file format menu,
  but still using FFMPEG. Unfortunately Ogg is broken at the moment
  (also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux,
  maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes
  it work.
* Organized file format menu by image/movie types.

Added:
* Render layers RNA wrapped, operatorized, layouted.
* FFMPEG format/codec options are now working.

Defaults changed:
* Compositing & Sequencer enabled.
* Tiles set to 8x8.
* Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
2009-07-13 19:09:13 +00:00

105 lines
2.5 KiB
Python

import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "data"
def poll(self, context):
return (context.camera != None)
class DATA_PT_context_camera(DataButtonsPanel):
__idname__ = "DATA_PT_context_camera"
__no_header__ = True
def draw(self, context):
layout = self.layout
ob = context.object
cam = context.camera
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif cam:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_camera(DataButtonsPanel):
__idname__ = "DATA_PT_camera"
__label__ = "Lens"
def draw(self, context):
layout = self.layout
cam = context.camera
layout.itemR(cam, "type", expand=True)
row = layout.row(align=True)
if cam.type == 'PERSP':
row.itemR(cam, "lens_unit", text="")
if cam.lens_unit == 'MILLIMETERS':
row.itemR(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES':
row.itemR(cam, "angle")
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
split = layout.split()
split.itemR(cam, "panorama");
split.itemL()
split = layout.split()
sub = split.column(align=True)
sub.itemL(text="Shift:")
sub.itemR(cam, "shift_x", text="X")
sub.itemR(cam, "shift_y", text="Y")
sub = split.column(align=True)
sub.itemL(text="Clipping:")
sub.itemR(cam, "clip_start", text="Start")
sub.itemR(cam, "clip_end", text="End")
split = layout.split()
col = split.column()
col.itemL(text="Depth of Field:")
col.itemR(cam, "dof_object", text="")
col = split.column()
col.itemL()
col.itemR(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
__idname__ = "DATA_PT_camera_display"
__label__ = "Display"
def draw(self, context):
cam = context.camera
layout = self.layout
split = layout.split()
sub = split.column()
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")
col = split.column()
col.itemR(cam, "show_passepartout", text="Passepartout")
colsub = col.column()
colsub.active = cam.show_passepartout
colsub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
col.itemR(cam, "draw_size", text="Size")
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
bpy.types.register(DATA_PT_camera_display)