2.5
[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                 layout = self.layout
14                 rd = context.scene.render_data
15                 
16                 split = layout.split()
17                 
18                 sub = split.column()
19                 sub.itemR(rd, "render_shadows", text="Shadows")
20                 sub.itemR(rd, "render_sss", text="Subsurface Scattering")
21                 sub.itemR(rd, "render_envmaps", text="Environment Map")
22                 #       sub.itemR(rd, "render_radiosity", text="Radio")
23                 
24                 col = split.column()
25                 col.itemR(rd, "render_raytracing", text="Ray Tracing")
26                 colsub = col.column()
27                 colsub.active = rd.render_raytracing
28                 colsub.itemR(rd, "octree_resolution", text="Octree")
29                 col.itemR(rd, "dither_intensity", text="Dither", slider=True)
30                 
31 class RENDER_PT_output(RenderButtonsPanel):
32         __label__ = "Output"
33
34         def draw(self, context):
35                 layout = self.layout
36                 rd = context.scene.render_data
37                 
38                 layout.itemR(rd, "display_mode", text="Display")
39                 
40                 layout.itemR(rd, "output_path")
41                 
42                 split = layout.split()
43                 
44                 col = split.column()
45                 col.itemR(rd, "file_extensions")                
46                 col.itemR(rd, "fields", text="Fields")
47                 colsub = col.column()
48                 colsub.active = rd.fields
49                 colsub.itemR(rd, "fields_still", text="Still")
50                 colsub.row().itemR(rd, "field_order", expand=True)
51                 
52                 col = split.column()
53                 col.itemR(rd, "color_mode")
54                 col.itemR(rd, "alpha_mode")
55                 col.itemL(text="Distributed Rendering:")
56                 col.itemR(rd, "placeholders")
57                 col.itemR(rd, "no_overwrite")
58                 
59                 layout.itemR(rd, "file_format", text="Format")
60                 
61                 split = layout.split()
62                 
63                 col = split.column()
64                 
65                 if rd.file_format in ('AVIJPEG', 'JPEG'):
66                         col.itemR(rd, "quality", slider=True)
67                         
68                 elif rd.file_format == 'OPENEXR':
69                         col.itemR(rd, "exr_codec")
70                         col.itemR(rd, "exr_half")
71                         col = split.column()
72                         col.itemR(rd, "exr_zbuf")
73                         col.itemR(rd, "exr_preview")
74                 
75                 elif rd.file_format == 'JPEG2000':
76                         row = layout.row()
77                         row.itemR(rd, "jpeg_preset")
78                         split = layout.split()
79                         col = split.column()
80                         col.itemL(text="Depth:")
81                         col.row().itemR(rd, "jpeg_depth", expand=True)
82                         col = split.column()
83                         col.itemR(rd, "jpeg_ycc")
84                         col.itemR(rd, "exr_preview")
85                         
86                 elif rd.file_format in ('CINEON', 'DPX'):
87                         col.itemR(rd, "cineon_log", text="Convert to Log")
88                         colsub = col.column()
89                         colsub.active = rd.cineon_log
90                         colsub.itemR(rd, "cineon_black", text="Black")
91                         colsub.itemR(rd, "cineon_white", text="White")
92                         colsub.itemR(rd, "cineon_gamma", text="Gamma")
93                         
94                 elif rd.file_format == 'TIFF':
95                         col.itemR(rd, "tiff_bit")
96                 
97                 elif rd.file_format == 'FFMPEG':
98                         #row = layout.row()
99                         #row.itemR(rd, "ffmpeg_format")
100                         #row.itemR(rd, "ffmpeg_codec")
101                         split = layout.split()
102                 
103                         col = split.column()
104                         col.itemR(rd, "ffmpeg_video_bitrate")
105                         col.itemL(text="Rate:")
106                         col.itemR(rd, "ffmpeg_minrate", text="Minimum")
107                         col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
108                         col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
109                         
110                         col = split.column()
111                         col.itemR(rd, "ffmpeg_gopsize")
112                         col.itemR(rd, "ffmpeg_autosplit")
113                         col.itemL(text="Mux:")
114                         col.itemR(rd, "ffmpeg_muxrate", text="Rate")
115                         col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
116                         
117                         row = layout.row()
118                         row.itemL(text="Audio:")
119                         row = layout.row()
120                         #row.itemR(rd, "ffmpeg_audio_codec")
121                         
122                         split = layout.split()
123         
124                         col = split.column()
125                         col.itemR(rd, "ffmpeg_audio_bitrate")
126                         col = split.column()
127                         col.itemR(rd, "ffmpeg_multiplex_audio")
128
129 class RENDER_PT_antialiasing(RenderButtonsPanel):
130         __label__ = "Anti-Aliasing"
131
132         def draw_header(self, context):
133                 layout = self.layout
134                 rd = context.scene.render_data
135
136                 layout.itemR(rd, "antialiasing", text="")
137
138         def draw(self, context):
139                 layout = self.layout
140                 rd = context.scene.render_data
141
142                 layout.active = rd.antialiasing
143
144                 split = layout.split()
145                 
146                 sub = split.column()
147                 sub.itemL(text="Samples:")
148                 sub.row().itemR(rd, "antialiasing_samples", expand=True)
149                 sub.itemR(rd, "pixel_filter")
150
151                 col = split.column()
152                 col.itemR(rd, "filter_size", text="Size", slider=True)
153                 col.itemR(rd, "save_buffers")
154                 colsub = col.column()
155                 colsub.active = rd.save_buffers
156                 colsub.itemR(rd, "full_sample")
157
158 class RENDER_PT_render(RenderButtonsPanel):
159         __label__ = "Render"
160
161         def draw(self, context):
162                 layout = self.layout
163                 rd = context.scene.render_data
164
165                 row = layout.row()
166                 row.itemO("SCREEN_OT_render", text="Render Still", icon='ICON_IMAGE_COL')
167                 row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon='ICON_SEQUENCE')
168                 
169                 row = layout.row()
170                 row.itemR(rd, "do_composite")
171                 row.itemR(rd, "do_sequence")
172                 rowsub = layout.row()
173                 rowsub.active = rd.do_composite
174                 rowsub.itemR(rd, "free_image_textures")
175
176                 split = layout.split()
177                 
178                 col = split.column(align=True)
179                 col.itemL(text="Threads:")
180                 col.row().itemR(rd, "threads_mode", expand=True)
181                 colsub = col.column()
182                 colsub.active = rd.threads_mode == 'THREADS_FIXED'
183                 colsub.itemR(rd, "threads")
184                 
185                 sub = split.column(align=True)
186                 sub.itemL(text="Tiles:")
187                 sub.itemR(rd, "parts_x", text="X")
188                 sub.itemR(rd, "parts_y", text="Y")
189                 
190                 split = layout.split()
191                 sub = split.column()
192                 sub = split.column()
193                 sub.itemR(rd, "panorama")
194                 
195                 #       row.itemR(rd, "backbuf")
196                         
197 class RENDER_PT_dimensions(RenderButtonsPanel):
198         __label__ = "Dimensions"
199
200         def draw(self, context):
201                 layout = self.layout
202                 
203                 scene = context.scene
204                 rd = scene.render_data
205                 
206                 split = layout.split()
207                 
208                 col = split.column()
209                 sub = col.column(align=True)
210                 sub.itemL(text="Resolution:")
211                 sub.itemR(rd, "resolution_x", text="X")
212                 sub.itemR(rd, "resolution_y", text="Y")
213                 sub.itemR(rd, "resolution_percentage", text="")
214                 
215                 sub.itemL(text="Aspect Ratio:")
216                 sub.itemR(rd, "pixel_aspect_x", text="X")
217                 sub.itemR(rd, "pixel_aspect_y", text="Y")
218                 
219                 col = col.column(align=False)
220                 col.itemR(rd, "border", text="Border")
221                 colsub = col.column()
222                 colsub.active = rd.border
223                 colsub.itemR(rd, "crop_to_border")
224
225                 col = split.column(align=True)
226                 col.itemL(text="Frame Range:")
227                 col.itemR(scene, "start_frame", text="Start")
228                 col.itemR(scene, "end_frame", text="End")
229                 col.itemR(scene, "frame_step", text="Step")
230                 
231                 col.itemL(text="Frame Rate:")
232                 col.itemR(rd, "fps")
233                 col.itemR(rd, "fps_base",text="/")
234
235 class RENDER_PT_stamp(RenderButtonsPanel):
236         __label__ = "Stamp"
237
238         def draw_header(self, context):
239                 rd = context.scene.render_data
240
241                 layout = self.layout
242                 layout.itemR(rd, "stamp", text="")
243
244         def draw(self, context):
245                 layout = self.layout
246                 rd = context.scene.render_data
247
248                 layout.active = rd.stamp
249
250                 split = layout.split()
251                 
252                 col = split.column()
253                 col.itemR(rd, "stamp_time", text="Time")
254                 col.itemR(rd, "stamp_date", text="Date")
255                 col.itemR(rd, "stamp_frame", text="Frame")
256                 col.itemR(rd, "stamp_camera", text="Scene")
257                 col.itemR(rd, "stamp_marker", text="Marker")
258                 col.itemR(rd, "stamp_filename", text="Filename")
259                 col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
260                 col.itemR(rd, "stamp_note", text="Note")
261                 colsub = col.column()
262                 colsub.active = rd.stamp_note
263                 colsub.itemR(rd, "stamp_note_text", text="")
264                 
265                 sub = split.column()
266                 sub.itemR(rd, "render_stamp")
267                 colsub = sub.column()
268                 colsub.active = rd.render_stamp
269                 colsub.itemR(rd, "stamp_foreground", slider=True)
270                 colsub.itemR(rd, "stamp_background", slider=True)
271                 colsub.itemR(rd, "stamp_font_size", text="Font Size")
272
273 bpy.types.register(RENDER_PT_render)
274 bpy.types.register(RENDER_PT_dimensions)
275 bpy.types.register(RENDER_PT_antialiasing)
276 bpy.types.register(RENDER_PT_shading)
277 bpy.types.register(RENDER_PT_output)
278 bpy.types.register(RENDER_PT_stamp)