blender/release/ui/buttons_scene.py

214 lines
5.5 KiB
Python
Raw Normal View History

import bpy
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = "BUTTONS_WINDOW"
__region_type__ = "WINDOW"
__context__ = "scene"
class RENDER_PT_shading(RenderButtonsPanel):
__label__ = "Shading"
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
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()
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
sub = split.column()
sub.itemR(rd, "render_shadows", text="Shadows")
sub.itemR(rd, "render_sss", text="Subsurface Scattering")
sub.itemR(rd, "render_envmaps", text="Environment Map")
# sub.itemR(rd, "render_radiosity", text="Radio")
sub = split.column()
sub.itemR(rd, "render_raytracing", text="Ray Tracing")
if (rd.render_raytracing):
sub.itemR(rd, "octree_resolution", text="Octree")
sub.itemR(rd, "dither_intensity", text="Dither", slider=True)
class RENDER_PT_output(RenderButtonsPanel):
__label__ = "Output"
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
layout.itemR(rd, "output_path")
split = layout.split()
sub = split.column()
sub.itemR(rd, "file_format", text="Format")
if rd.file_format in ("AVIJPEG", "JPEG"):
sub.itemR(rd, "quality", slider=True)
sub = split.column()
sub.itemR(rd, "color_mode")
sub.itemR(rd, "alpha_mode")
split = layout.split()
sub = split.column()
sub.itemL(text="Distributed Rendering:")
sub.itemR(rd, "placeholders")
sub.itemR(rd, "no_overwrite")
sub = split.column()
sub.itemL(text="Settings:")
sub.itemR(rd, "file_extensions")
sub.itemR(rd, "fields", text="Fields")
if rd.fields:
sub.itemR(rd, "fields_still", text="Still")
sub.row().itemR(rd, "field_order", expand=True)
class RENDER_PT_antialiasing(RenderButtonsPanel):
__label__ = "Anti-Aliasing"
def draw_header(self, context):
rd = context.scene.render_data
layout = self.layout
layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
split = layout.split()
sub = split.column()
sub.itemL(text="Samples:")
sub.row().itemR(rd, "antialiasing_samples", expand=True)
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
sub = split.column()
sub.itemR(rd, "pixel_filter")
sub.itemR(rd, "filter_size", text="Size", slider=True)
sub.itemR(rd, "save_buffers")
if rd.save_buffers:
sub.itemR(rd, "full_sample")
class RENDER_PT_render(RenderButtonsPanel):
__label__ = "Render"
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
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
row = layout.row()
row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
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
row = layout.row()
row.itemR(rd, "do_composite", toggle=True)
row.itemR(rd, "do_sequence", toggle=True)
if rd.do_composite:
row = layout.row()
row.itemR(rd, "free_image_textures")
split = layout.split()
sub = split.column(align=True)
sub.itemL(text="Threads:")
sub.row().itemR(rd, "threads_mode", expand=True)
if rd.threads_mode == 'THREADS_FIXED':
sub.itemR(rd, "threads")
sub = split.column(align=True)
sub.itemL(text="Tiles:")
sub.itemR(rd, "parts_x", text="X")
sub.itemR(rd, "parts_y", text="Y")
split = layout.split()
sub = split.column()
sub = split.column()
sub.itemR(rd, "panorama")
# row.itemR(rd, "backbuf")
class RENDER_PT_dimensions(RenderButtonsPanel):
__label__ = "Dimensions"
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
split = layout.split()
2009-05-20 13:56:22 +00:00
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Resolution:")
sub.itemR(rd, "resolution_x", text="X")
sub.itemR(rd, "resolution_y", text="Y")
sub.itemR(rd, "resolution_percentage", text="")
sub.itemL(text="Aspect Ratio:")
sub.itemR(rd, "pixel_aspect_x", text="X")
sub.itemR(rd, "pixel_aspect_y", text="Y")
sub = col.column(align=False)
sub.itemR(rd, "border", text="Border")
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
if rd.border:
sub.itemR(rd, "crop_to_border")
2009-05-20 13:56:22 +00:00
col = split.column(align=True)
col.itemL(text="Frame Range:")
col.itemR(scene, "start_frame", text="Start")
col.itemR(scene, "end_frame", text="End")
col.itemR(scene, "frame_step", text="Step")
col.itemL(text="Frame Rate:")
col.itemR(rd, "fps")
col.itemR(rd, "fps_base",text="/")
class RENDER_PT_stamp(RenderButtonsPanel):
__label__ = "Stamp"
def draw_header(self, context):
rd = context.scene.render_data
layout = self.layout
layout.itemR(rd, "stamp", text="")
def draw(self, context):
scene = context.scene
layout = self.layout
rd = scene.render_data
split = layout.split()
sub = split.column(align=True)
sub.itemR(rd, "stamp_time", text="Time", toggle=True)
sub.itemR(rd, "stamp_date", text="Date", toggle=True)
sub.itemR(rd, "stamp_frame", text="Frame", toggle=True)
sub.itemR(rd, "stamp_camera", text="Scene", toggle=True)
sub.itemR(rd, "stamp_marker", text="Marker", toggle=True)
sub.itemR(rd, "stamp_filename", text="Filename", toggle=True)
sub.itemR(rd, "stamp_sequence_strip", text="Seq. Strip", toggle=True)
sub.itemR(rd, "stamp_note", text="Note", toggle=True)
if (rd.stamp_note):
sub.itemR(rd, "stamp_note_text", text="")
2009-05-20 13:56:22 +00:00
sub = split.column()
sub.itemR(rd, "render_stamp")
sub.itemR(rd, "stamp_foreground")
sub.itemR(rd, "stamp_background")
sub.itemR(rd, "stamp_font_size", text="Font Size")
bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
bpy.types.register(RENDER_PT_output)
bpy.types.register(RENDER_PT_stamp)