2.5 Buttons:
[blender.git] / release / ui / buttons_scene.py
1
2 import bpy
3
4 class RenderButtonsPanel(bpy.types.Panel):
5         __space_type__ = "BUTTONS_WINDOW"
6         __region_type__ = "WINDOW"
7         __context__ = "scene"
8
9 class RENDER_PT_shading(RenderButtonsPanel):
10         __label__ = "Shading"
11
12         def draw(self, context):
13                 scene = context.scene
14                 layout = self.layout
15
16                 rd = scene.render_data
17                 
18                 split = layout.split()
19                 
20                 sub = split.column()
21                 sub.itemR(rd, "render_shadows", text="Shadows")
22                 sub.itemR(rd, "render_sss", text="Subsurface Scattering")
23                 sub.itemR(rd, "render_envmaps", text="Environment Map")
24                 #       sub.itemR(rd, "render_radiosity", text="Radio")
25                 
26                 sub = split.column()
27                 sub.itemR(rd, "render_raytracing", text="Ray Tracing")
28                 if (rd.render_raytracing):
29                         sub.itemR(rd, "octree_resolution", text="Octree")
30                 
31 class RENDER_PT_output(RenderButtonsPanel):
32         __label__ = "Output"
33
34         def draw(self, context):
35                 scene = context.scene
36                 layout = self.layout
37
38                 rd = scene.render_data
39                 
40                 col = layout.column()
41                 col.itemR(rd, "output_path")
42                 
43                 split = layout.split()
44                 
45                 sub = split.column()
46                 sub.itemR(rd, "image_type")
47                 if rd.image_type in ("AVIJPEG", "JPEG"):
48                         sub.itemR(rd, "quality", slider=True)
49                 
50                 sub = split.column()
51                 sub.itemR(rd, "color_mode")
52                 sub.itemR(rd, "alpha_mode")
53                 
54                 split = layout.split()
55                 
56                 sub = split.column()
57                 sub.itemL(text="Distributed Rendering:")
58                 sub.itemR(rd, "placeholders")
59                 sub.itemR(rd, "no_overwrite")
60                 
61                 sub = split.column()
62                 sub.itemL(text="Settings:")
63                 sub.itemR(rd, "file_extensions")
64                 sub.itemR(rd, "fields", text="Fields")
65                 if rd.fields:
66                         sub.itemR(rd, "fields_still", text="Still")
67                         sub.row().itemR(rd, "field_order", expand=True)
68                 
69         
70 class RENDER_PT_antialiasing(RenderButtonsPanel):
71         __label__ = "Anti-Aliasing"
72
73         def draw_header(self, context):
74                 rd = context.scene.render_data
75
76                 layout = self.layout
77                 layout.itemR(rd, "antialiasing", text="")
78
79         def draw(self, context):
80                 scene = context.scene
81                 layout = self.layout
82
83                 rd = scene.render_data
84
85                 split = layout.split()
86                 
87                 sub = split.column()
88                 sub.itemL(text="Samples:")
89                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
90
91                 sub = split.column()
92                 sub.itemR(rd, "pixel_filter")
93                 sub.itemR(rd, "filter_size", text="Size", slider=True)
94                 sub.itemR(rd, "save_buffers")
95                 if rd.save_buffers:
96                         sub.itemR(rd, "full_sample")
97
98 class RENDER_PT_render(RenderButtonsPanel):
99         __label__ = "Render"
100
101         def draw(self, context):
102                 scene = context.scene
103                 layout = self.layout
104
105                 rd = scene.render_data
106
107                 row = layout.row()
108                 row.itemO("SCREEN_OT_render", text="Render Still")
109                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation")
110                 
111                 row = layout.row()
112                 row.itemR(rd, "do_composite")
113                 row.itemR(rd, "do_sequence")
114                 if rd.do_composite:
115                         row = layout.row()
116                         row.itemR(rd, "free_image_textures")
117
118                 split = layout.split()
119                 
120                 sub = split.column(align=True)
121                 sub.itemL(text="Threads:")
122                 sub.row().itemR(rd, "threads_mode", expand=True)
123                 if rd.threads_mode == 'THREADS_FIXED':
124                         sub.itemR(rd, "threads")
125                 
126                 sub = split.column(align=True)
127                 sub.itemL(text="Tiles:")
128                 sub.itemR(rd, "parts_x", text="X")
129                 sub.itemR(rd, "parts_y", text="Y")
130                 
131                 row = layout.row()
132                 row.itemR(rd, "panorama")
133                 row.itemR(rd, "dither_intensity", text="Dither", slider=True)
134                 #       row.itemR(rd, "backbuf")
135                         
136 class RENDER_PT_dimensions(RenderButtonsPanel):
137         __label__ = "Dimensions"
138
139         def draw(self, context):
140                 scene = context.scene
141                 layout = self.layout
142
143                 rd = scene.render_data
144                 
145                 split = layout.split()
146                 
147                 col = split.column()
148                 sub = col.column(align=True)
149                 sub.itemL(text="Resolution:")
150                 sub.itemR(rd, "resolution_x", text="X")
151                 sub.itemR(rd, "resolution_y", text="Y")
152                 sub.itemR(rd, "resolution_percentage", text="")
153                 
154                 sub.itemL(text="Aspect Ratio:")
155                 sub.itemR(rd, "pixel_aspect_x", text="X")
156                 sub.itemR(rd, "pixel_aspect_y", text="Y")
157                 
158                 sub = col.column()
159                 sub.itemR(rd, "border", text="Border")
160                 if rd.border:
161                         sub.itemR(rd, "crop_to_border")
162
163                 col = split.column(align=True)
164                 col.itemL(text="Frame Range:")
165                 col.itemR(scene, "start_frame", text="Start")
166                 col.itemR(scene, "end_frame", text="End")
167                 col.itemR(scene, "frame_step", text="Step")
168                 
169                 col.itemL(text="Frame Rate:")
170                 col.itemR(rd, "fps")
171                 col.itemR(rd, "fps_base",text="/")
172                 
173 bpy.types.register(RENDER_PT_render)
174 bpy.types.register(RENDER_PT_dimensions)
175 bpy.types.register(RENDER_PT_antialiasing)
176 bpy.types.register(RENDER_PT_shading)
177 bpy.types.register(RENDER_PT_output)