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