2009-04-27 18:05:58 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
class DataButtonsPanel(bpy.types.Panel):
|
2009-08-22 08:48:01 +00:00
|
|
|
__space_type__ = 'PROPERTIES'
|
|
|
|
__region_type__ = 'WINDOW'
|
2009-04-27 18:05:58 +00:00
|
|
|
__context__ = "data"
|
|
|
|
|
2009-05-04 15:53:55 +00:00
|
|
|
def poll(self, context):
|
2009-09-01 00:33:39 +00:00
|
|
|
return (context.camera)
|
2009-05-08 18:17:57 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
class DATA_PT_context_camera(DataButtonsPanel):
|
2009-07-26 03:54:17 +00:00
|
|
|
__show_header__ = False
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-05-04 15:53:55 +00:00
|
|
|
def draw(self, context):
|
2009-06-13 21:22:21 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
ob = context.object
|
2009-06-03 00:17:35 +00:00
|
|
|
cam = context.camera
|
2009-06-07 13:36:12 +00:00
|
|
|
space = context.space_data
|
2009-05-04 15:53:55 +00:00
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
split = layout.split(percentage=0.65)
|
|
|
|
|
|
|
|
if ob:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(ob, "data")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
2009-07-09 19:45:27 +00:00
|
|
|
elif cam:
|
2009-06-23 00:19:10 +00:00
|
|
|
split.template_ID(space, "pin_id")
|
2009-06-07 13:36:12 +00:00
|
|
|
split.itemS()
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2009-07-09 09:07:25 +00:00
|
|
|
class DATA_PT_camera(DataButtonsPanel):
|
|
|
|
__label__ = "Lens"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
layout.itemR(cam, "type", expand=True)
|
2009-05-15 16:24:08 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
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")
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
elif cam.type == 'ORTHO':
|
|
|
|
row.itemR(cam, "ortho_scale")
|
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
|
|
|
|
2009-09-01 00:33:39 +00:00
|
|
|
layout.itemR(cam, "panorama")
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-09 16:09:44 +00:00
|
|
|
split = layout.split()
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemL(text="Shift:")
|
|
|
|
col.itemR(cam, "shift_x", text="X")
|
|
|
|
col.itemR(cam, "shift_y", text="Y")
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column(align=True)
|
|
|
|
col.itemL(text="Clipping:")
|
|
|
|
col.itemR(cam, "clip_start", text="Start")
|
|
|
|
col.itemR(cam, "clip_end", text="End")
|
2009-06-07 13:36:12 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
layout.itemL(text="Depth of Field:")
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.itemR(cam, "dof_object", text="")
|
|
|
|
row.itemR(cam, "dof_distance", text="Distance")
|
2009-05-04 15:53:55 +00:00
|
|
|
|
2009-06-07 13:36:12 +00:00
|
|
|
class DATA_PT_camera_display(DataButtonsPanel):
|
2009-05-04 15:53:55 +00:00
|
|
|
__label__ = "Display"
|
2009-06-13 21:22:21 +00:00
|
|
|
|
2009-05-04 15:53:55 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-27 20:39:10 +00:00
|
|
|
|
|
|
|
cam = context.camera
|
2009-05-04 15:53:55 +00:00
|
|
|
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
split = layout.split()
|
2009-05-04 15:53:55 +00:00
|
|
|
|
2009-07-27 20:39:10 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(cam, "show_limits", text="Limits")
|
|
|
|
col.itemR(cam, "show_mist", text="Mist")
|
|
|
|
col.itemR(cam, "show_title_safe", text="Title Safe")
|
|
|
|
col.itemR(cam, "show_name", text="Name")
|
2009-05-18 18:20:29 +00:00
|
|
|
|
2009-05-29 09:53:46 +00:00
|
|
|
col = split.column()
|
|
|
|
col.itemR(cam, "show_passepartout", text="Passepartout")
|
2009-07-27 20:39:10 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.active = cam.show_passepartout
|
|
|
|
sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
|
2009-05-29 09:53:46 +00:00
|
|
|
col.itemR(cam, "draw_size", text="Size")
|
2009-05-04 15:53:55 +00:00
|
|
|
|
2009-07-09 09:42:34 +00:00
|
|
|
bpy.types.register(DATA_PT_context_camera)
|
2009-06-07 13:36:12 +00:00
|
|
|
bpy.types.register(DATA_PT_camera)
|
2009-06-18 14:20:25 +00:00
|
|
|
bpy.types.register(DATA_PT_camera_display)
|